mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 14:50:47 -07:00
Improve kernel events implementation (#430)
* Improve kernel events implementation * Some cleanup * Address PR feedback
This commit is contained in:
committed by
Thomas Guillemard
parent
54ed9096bd
commit
7de7b559ad
@ -1,38 +1,14 @@
|
||||
namespace Ryujinx.HLE.HOS.Kernel
|
||||
{
|
||||
class KEvent : KSynchronizationObject
|
||||
class KEvent
|
||||
{
|
||||
private bool Signaled;
|
||||
public KReadableEvent ReadableEvent { get; private set; }
|
||||
public KWritableEvent WritableEvent { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public KEvent(Horizon System, string Name = "") : base(System)
|
||||
public KEvent(Horizon System)
|
||||
{
|
||||
this.Name = Name;
|
||||
}
|
||||
|
||||
public override void Signal()
|
||||
{
|
||||
System.CriticalSectionLock.Lock();
|
||||
|
||||
if (!Signaled)
|
||||
{
|
||||
Signaled = true;
|
||||
|
||||
base.Signal();
|
||||
}
|
||||
|
||||
System.CriticalSectionLock.Unlock();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Signaled = false;
|
||||
}
|
||||
|
||||
public override bool IsSignaled()
|
||||
{
|
||||
return Signaled;
|
||||
ReadableEvent = new KReadableEvent(System, this);
|
||||
WritableEvent = new KWritableEvent(this);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user