2018-05-13 05:22:42 +02:00
|
|
|
using System;
|
|
|
|
using System.Threading;
|
|
|
|
|
2018-06-11 02:46:42 +02:00
|
|
|
namespace Ryujinx.HLE.OsHle.Handles
|
2018-05-13 05:22:42 +02:00
|
|
|
{
|
|
|
|
class SchedulerThread : IDisposable
|
|
|
|
{
|
|
|
|
public KThread Thread { get; private set; }
|
|
|
|
|
|
|
|
public SchedulerThread Next { get; set; }
|
|
|
|
|
|
|
|
public bool IsActive { get; set; }
|
|
|
|
|
2018-06-26 06:09:32 +02:00
|
|
|
public bool IsRunning { get; set; }
|
|
|
|
|
2018-05-13 05:22:42 +02:00
|
|
|
public AutoResetEvent WaitSync { get; private set; }
|
|
|
|
public ManualResetEvent WaitActivity { get; private set; }
|
|
|
|
public AutoResetEvent WaitSched { get; private set; }
|
|
|
|
|
|
|
|
public SchedulerThread(KThread Thread)
|
|
|
|
{
|
|
|
|
this.Thread = Thread;
|
|
|
|
|
|
|
|
IsActive = true;
|
|
|
|
|
|
|
|
WaitSync = new AutoResetEvent(false);
|
|
|
|
|
|
|
|
WaitActivity = new ManualResetEvent(true);
|
|
|
|
|
|
|
|
WaitSched = new AutoResetEvent(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
Dispose(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool Disposing)
|
|
|
|
{
|
|
|
|
if (Disposing)
|
|
|
|
{
|
|
|
|
WaitSync.Dispose();
|
|
|
|
|
|
|
|
WaitActivity.Dispose();
|
|
|
|
|
|
|
|
WaitSched.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|