SchedulerThread.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Threading;
  3. namespace Ryujinx.HLE.OsHle.Handles
  4. {
  5. class SchedulerThread : IDisposable
  6. {
  7. public KThread Thread { get; private set; }
  8. public SchedulerThread Next { get; set; }
  9. public bool IsActive { get; set; }
  10. public AutoResetEvent WaitSync { get; private set; }
  11. public ManualResetEvent WaitActivity { get; private set; }
  12. public AutoResetEvent WaitSched { get; private set; }
  13. public SchedulerThread(KThread Thread)
  14. {
  15. this.Thread = Thread;
  16. IsActive = true;
  17. WaitSync = new AutoResetEvent(false);
  18. WaitActivity = new ManualResetEvent(true);
  19. WaitSched = new AutoResetEvent(false);
  20. }
  21. public void Dispose()
  22. {
  23. Dispose(true);
  24. }
  25. protected virtual void Dispose(bool Disposing)
  26. {
  27. if (Disposing)
  28. {
  29. WaitSync.Dispose();
  30. WaitActivity.Dispose();
  31. WaitSched.Dispose();
  32. }
  33. }
  34. }
  35. }