2018-09-18 23:36:43 +00:00
|
|
|
using System.Collections.Generic;
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
namespace Ryujinx.HLE.HOS.Kernel
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2018-11-28 22:18:09 +00:00
|
|
|
class KSynchronizationObject : KAutoObject
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2018-09-18 23:36:43 +00:00
|
|
|
public LinkedList<KThread> WaitingThreads;
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public KSynchronizationObject(Horizon System) : base(System)
|
2018-09-18 23:36:43 +00:00
|
|
|
{
|
|
|
|
WaitingThreads = new LinkedList<KThread>();
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public LinkedListNode<KThread> AddWaitingThread(KThread Thread)
|
2018-09-18 23:36:43 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
return WaitingThreads.AddLast(Thread);
|
2018-09-18 23:36:43 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public void RemoveWaitingThread(LinkedListNode<KThread> Node)
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
WaitingThreads.Remove(Node);
|
2018-03-19 18:58:46 +00:00
|
|
|
}
|
|
|
|
|
2018-09-18 23:36:43 +00:00
|
|
|
public virtual void Signal()
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2018-09-18 23:36:43 +00:00
|
|
|
System.Synchronization.SignalObject(this);
|
2018-03-19 18:58:46 +00:00
|
|
|
}
|
|
|
|
|
2018-09-18 23:36:43 +00:00
|
|
|
public virtual bool IsSignaled()
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2018-09-18 23:36:43 +00:00
|
|
|
return false;
|
2018-03-19 18:58:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|