aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Handles
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Core/OsHle/Handles')
-rw-r--r--Ryujinx.Core/OsHle/Handles/KProcessScheduler.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.Core/OsHle/Handles/KProcessScheduler.cs b/Ryujinx.Core/OsHle/Handles/KProcessScheduler.cs
index 238febd0..7cdf5f9c 100644
--- a/Ryujinx.Core/OsHle/Handles/KProcessScheduler.cs
+++ b/Ryujinx.Core/OsHle/Handles/KProcessScheduler.cs
@@ -95,6 +95,11 @@ namespace Ryujinx.Core.OsHle.Handles
return Threads.Contains(SchedThread);
}
}
+
+ public bool Remove(SchedulerThread SchedThread)
+ {
+ return Threads.Remove(SchedThread);
+ }
}
private ConcurrentDictionary<KThread, SchedulerThread> AllThreads;
@@ -153,6 +158,11 @@ namespace Ryujinx.Core.OsHle.Handles
lock (SchedLock)
{
+ if (AllThreads.TryRemove(Thread, out SchedulerThread SchedThread))
+ {
+ WaitingToRun[Thread.ProcessorId].Remove(SchedThread);
+ }
+
SchedulerThread NewThread = WaitingToRun[Thread.ProcessorId].Pop();
if (NewThread == null)