SchedulerThread.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 bool IsRunning { get; set; }
  11. public AutoResetEvent WaitSync { get; private set; }
  12. public ManualResetEvent WaitActivity { get; private set; }
  13. public AutoResetEvent WaitSched { get; private set; }
  14. public SchedulerThread(KThread Thread)
  15. {
  16. this.Thread = Thread;
  17. IsActive = true;
  18. WaitSync = new AutoResetEvent(false);
  19. WaitActivity = new ManualResetEvent(true);
  20. WaitSched = new AutoResetEvent(false);
  21. }
  22. public void Dispose()
  23. {
  24. Dispose(true);
  25. }
  26. protected virtual void Dispose(bool Disposing)
  27. {
  28. if (Disposing)
  29. {
  30. WaitSync.Dispose();
  31. WaitActivity.Dispose();
  32. WaitSched.Dispose();
  33. }
  34. }
  35. }
  36. }