|
@@ -197,30 +197,40 @@ namespace Ryujinx.Core.OsHle.Handles
|
|
|
|
|
|
|
|
if (NeedsReschedule)
|
|
if (NeedsReschedule)
|
|
|
{
|
|
{
|
|
|
- PrintDbgThreadInfo(Thread, "yielded execution.");
|
|
|
|
|
-
|
|
|
|
|
- lock (SchedLock)
|
|
|
|
|
- {
|
|
|
|
|
- int ActualCore = Thread.ActualCore;
|
|
|
|
|
|
|
+ Yield(Thread, Thread.ActualPriority - 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- SchedulerThread NewThread = WaitingToRun.Pop(ActualCore, Thread.ActualPriority);
|
|
|
|
|
|
|
+ public void Yield(KThread Thread)
|
|
|
|
|
+ {
|
|
|
|
|
+ Yield(Thread, Thread.ActualPriority);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (NewThread == null)
|
|
|
|
|
- {
|
|
|
|
|
- PrintDbgThreadInfo(Thread, "resumed because theres nothing better to run.");
|
|
|
|
|
|
|
+ private void Yield(KThread Thread, int MinPriority)
|
|
|
|
|
+ {
|
|
|
|
|
+ PrintDbgThreadInfo(Thread, "yielded execution.");
|
|
|
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ lock (SchedLock)
|
|
|
|
|
+ {
|
|
|
|
|
+ int ActualCore = Thread.ActualCore;
|
|
|
|
|
|
|
|
- NewThread.Thread.ActualCore = ActualCore;
|
|
|
|
|
|
|
+ SchedulerThread NewThread = WaitingToRun.Pop(ActualCore, MinPriority);
|
|
|
|
|
|
|
|
- CoreThreads[ActualCore] = NewThread.Thread;
|
|
|
|
|
|
|
+ if (NewThread == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ PrintDbgThreadInfo(Thread, "resumed because theres nothing better to run.");
|
|
|
|
|
|
|
|
- RunThread(NewThread);
|
|
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Resume(Thread);
|
|
|
|
|
|
|
+ NewThread.Thread.ActualCore = ActualCore;
|
|
|
|
|
+
|
|
|
|
|
+ CoreThreads[ActualCore] = NewThread.Thread;
|
|
|
|
|
+
|
|
|
|
|
+ RunThread(NewThread);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ Resume(Thread);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void Resume(KThread Thread)
|
|
public void Resume(KThread Thread)
|