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