mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-09 16:19:09 +01:00
hle: kernel: KThread: DummyThread can be waited, ensure wait_queue is not nullptr.
This commit is contained in:
parent
46a620f9d7
commit
91ff6d4cb3
1 changed files with 6 additions and 6 deletions
|
@ -1097,14 +1097,14 @@ void KThread::EndWait(ResultCode wait_result_) {
|
||||||
// Lock the scheduler.
|
// Lock the scheduler.
|
||||||
KScopedSchedulerLock sl(kernel);
|
KScopedSchedulerLock sl(kernel);
|
||||||
|
|
||||||
// Dummy threads are just used by host threads for locking, and will never have a wait_queue.
|
// If we're waiting, notify our queue that we're available.
|
||||||
if (thread_type == ThreadType::Dummy) {
|
if (GetState() == ThreadState::Waiting) {
|
||||||
ASSERT_MSG(false, "Dummy threads should never call EndWait!");
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're waiting, notify our queue that we're available.
|
|
||||||
if (GetState() == ThreadState::Waiting) {
|
|
||||||
wait_queue->EndWait(this, wait_result_);
|
wait_queue->EndWait(this, wait_result_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue