2018-09-19 01:36:43 +02:00
|
|
|
using System.Collections.Generic;
|
2018-03-19 19:58:46 +01:00
|
|
|
|
2018-08-17 01:47:36 +02:00
|
|
|
namespace Ryujinx.HLE.HOS.Kernel
|
2018-03-19 19:58:46 +01:00
|
|
|
{
|
2018-11-28 23:18:09 +01:00
|
|
|
class KSynchronizationObject : KAutoObject
|
2018-03-19 19:58:46 +01:00
|
|
|
{
|
2018-09-19 01:36:43 +02:00
|
|
|
public LinkedList<KThread> WaitingThreads;
|
2018-03-19 19:58:46 +01:00
|
|
|
|
2018-12-04 21:23:37 +01:00
|
|
|
public KSynchronizationObject(Horizon system) : base(system)
|
2018-09-19 01:36:43 +02:00
|
|
|
{
|
|
|
|
WaitingThreads = new LinkedList<KThread>();
|
|
|
|
}
|
|
|
|
|
2018-12-04 21:23:37 +01:00
|
|
|
public LinkedListNode<KThread> AddWaitingThread(KThread thread)
|
2018-09-19 01:36:43 +02:00
|
|
|
{
|
2018-12-04 21:23:37 +01:00
|
|
|
return WaitingThreads.AddLast(thread);
|
2018-09-19 01:36:43 +02:00
|
|
|
}
|
|
|
|
|
2018-12-04 21:23:37 +01:00
|
|
|
public void RemoveWaitingThread(LinkedListNode<KThread> node)
|
2018-03-19 19:58:46 +01:00
|
|
|
{
|
2018-12-04 21:23:37 +01:00
|
|
|
WaitingThreads.Remove(node);
|
2018-03-19 19:58:46 +01:00
|
|
|
}
|
|
|
|
|
2018-09-19 01:36:43 +02:00
|
|
|
public virtual void Signal()
|
2018-03-19 19:58:46 +01:00
|
|
|
{
|
2018-09-19 01:36:43 +02:00
|
|
|
System.Synchronization.SignalObject(this);
|
2018-03-19 19:58:46 +01:00
|
|
|
}
|
|
|
|
|
2018-09-19 01:36:43 +02:00
|
|
|
public virtual bool IsSignaled()
|
2018-03-19 19:58:46 +01:00
|
|
|
{
|
2018-09-19 01:36:43 +02:00
|
|
|
return false;
|
2018-03-19 19:58:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|