summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_scheduler.cpp
diff options
context:
space:
mode:
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();