KSynchronizationObject.cs 804 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections.Generic;
  2. namespace Ryujinx.HLE.HOS.Kernel
  3. {
  4. class KSynchronizationObject : KAutoObject
  5. {
  6. public LinkedList<KThread> WaitingThreads;
  7. public KSynchronizationObject(Horizon System) : base(System)
  8. {
  9. WaitingThreads = new LinkedList<KThread>();
  10. }
  11. public LinkedListNode<KThread> AddWaitingThread(KThread Thread)
  12. {
  13. return WaitingThreads.AddLast(Thread);
  14. }
  15. public void RemoveWaitingThread(LinkedListNode<KThread> Node)
  16. {
  17. WaitingThreads.Remove(Node);
  18. }
  19. public virtual void Signal()
  20. {
  21. System.Synchronization.SignalObject(this);
  22. }
  23. public virtual bool IsSignaled()
  24. {
  25. return false;
  26. }
  27. }
  28. }