Better implementation of SetThreadCoreMask that allows changing the Core Mask (untested, no clue if it actually works)

This commit is contained in:
gdkchan 2018-05-13 22:00:29 -03:00
parent 4546d1b9be
commit b2b1d7dcd7
4 changed files with 109 additions and 3 deletions

View file

@ -196,6 +196,28 @@ namespace Ryujinx.Core.OsHle.Handles
Resume(Thread);
}
public bool TryRunning(KThread Thread)
{
if (!AllThreads.TryGetValue(Thread, out SchedulerThread SchedThread))
{
throw new InvalidOperationException();
}
lock (SchedLock)
{
if (WaitingToRun.HasThread(SchedThread) && AddActiveCore(Thread))
{
WaitingToRun.Remove(SchedThread);
RunThread(SchedThread);
return true;
}
return false;
}
}
public void Resume(KThread Thread)
{
if (!AllThreads.TryGetValue(Thread, out SchedulerThread SchedThread))