aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_scheduler.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-01-21 22:34:47 -0800
committerGitHub <noreply@github.com>2022-01-21 22:34:47 -0800
commit68c8a1b17093dabfaf8558163b6f7ff326ac9938 (patch)
tree4a8965dd8c142333e681564a8da803c2e4a45a56 /src/core/hle/kernel/k_scheduler.cpp
parentcef7649bedc2c8bf35fa52e58538b48030a1d266 (diff)
parent615fb40416b9ee10abf40a036b31d1540886a9b8 (diff)
Merge pull request #7737 from bunnei/fix-dummy-thread-leak
Various fixes to HLE service thread management
Diffstat (limited to 'src/core/hle/kernel/k_scheduler.cpp')
-rw-r--r--src/core/hle/kernel/k_scheduler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_scheduler.cpp b/src/core/hle/kernel/k_scheduler.cpp
index f900b2e7a..b32d4f285 100644
--- a/src/core/hle/kernel/k_scheduler.cpp
+++ b/src/core/hle/kernel/k_scheduler.cpp
@@ -406,6 +406,9 @@ void KScheduler::EnableScheduling(KernelCore& kernel, u64 cores_needing_scheduli
} else {
RescheduleCores(kernel, cores_needing_scheduling);
}
+
+ // Special case to ensure dummy threads that are waiting block.
+ current_thread->IfDummyThreadTryWait();
}
u64 KScheduler::UpdateHighestPriorityThreads(KernelCore& kernel) {
@@ -739,6 +742,12 @@ void KScheduler::ScheduleImpl() {
next_thread = idle_thread;
}
+ // We never want to schedule a dummy thread, as these are only used by host threads for locking.
+ if (next_thread->GetThreadType() == ThreadType::Dummy) {
+ ASSERT_MSG(false, "Dummy threads should never be scheduled!");
+ next_thread = idle_thread;
+ }
+
// If we're not actually switching thread, there's nothing to do.
if (next_thread == current_thread.load()) {
previous_thread->EnableDispatch();