KSynchronizationObject.cs 845 B

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