From 91ff6d4cb3aa4010e5856993c9291627c5c38f99 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 18 Jan 2022 17:56:08 -0800 Subject: hle: kernel: KThread: DummyThread can be waited, ensure wait_queue is not nullptr. --- src/core/hle/kernel/k_thread.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index a599723e6..4cbf12c11 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -1097,14 +1097,14 @@ void KThread::EndWait(ResultCode wait_result_) { // Lock the scheduler. KScopedSchedulerLock sl(kernel); - // Dummy threads are just used by host threads for locking, and will never have a wait_queue. - if (thread_type == ThreadType::Dummy) { - ASSERT_MSG(false, "Dummy threads should never call EndWait!"); - return; - } - // If we're waiting, notify our queue that we're available. if (GetState() == ThreadState::Waiting) { + if (wait_queue == nullptr) { + // This should never happen, but avoid a hard crash below to get this logged. + ASSERT_MSG(false, "wait_queue is nullptr!"); + return; + } + wait_queue->EndWait(this, wait_result_); } } -- cgit v1.2.3