Ryujinx/Ryujinx.HLE/HOS/Kernel/KSynchronizationObject.cs

34 lines
804 B
C#
Raw Normal View History

using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Kernel
{
class KSynchronizationObject : KAutoObject
{
public LinkedList<KThread> WaitingThreads;
2018-12-01 21:01:59 +01:00
public KSynchronizationObject(Horizon system) : base(system)
{
WaitingThreads = new LinkedList<KThread>();
}
2018-12-01 21:01:59 +01:00
public LinkedListNode<KThread> AddWaitingThread(KThread thread)
{
2018-12-01 21:01:59 +01:00
return WaitingThreads.AddLast(thread);
}
2018-12-01 21:01:59 +01:00
public void RemoveWaitingThread(LinkedListNode<KThread> node)
{
2018-12-01 21:01:59 +01:00
WaitingThreads.Remove(node);
}
public virtual void Signal()
{
System.Synchronization.SignalObject(this);
}
public virtual bool IsSignaled()
{
return false;
}
}
}