diff options
author | Subv <subv2112@gmail.com> | 2017-01-04 18:48:13 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2017-01-05 15:40:18 +0100 |
commit | dda4ec93bea089e3286e9a965378d9411f480acd (patch) | |
tree | 29b3fcb87e02fc92e514e28877b588f09264c026 /src/core/hle/kernel/thread.cpp | |
parent | Kernel: Remove a thread from all of its waiting objects' waiting_threads list when it is awoken. (diff) | |
download | yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.tar yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.tar.gz yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.tar.bz2 yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.tar.lz yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.tar.xz yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.tar.zst yuzu-dda4ec93bea089e3286e9a965378d9411f480acd.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 568cef5b9..9109bd10b 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -200,8 +200,8 @@ static void SwitchContext(Thread* new_thread) { // Load context of new thread if (new_thread) { - DEBUG_ASSERT_MSG(new_thread->status == THREADSTATUS_READY, - "Thread must be ready to become running."); + ASSERT_MSG(new_thread->status == THREADSTATUS_READY, + "Thread must be ready to become running."); // Cancel any outstanding wakeup events for this thread CoreTiming::UnscheduleEvent(ThreadWakeupEventType, new_thread->callback_handle); @@ -307,6 +307,8 @@ void Thread::WakeAfterDelay(s64 nanoseconds) { } void Thread::ResumeFromWait() { + ASSERT_MSG(wait_objects.empty(), "Thread is waking up while waiting for objects"); + switch (status) { case THREADSTATUS_WAIT_SYNCH_ALL: case THREADSTATUS_WAIT_SYNCH_ANY: @@ -580,6 +582,7 @@ void Thread::SetWaitSynchronizationOutput(s32 output) { } s32 Thread::GetWaitObjectIndex(WaitObject* object) const { + ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); return std::distance(match, wait_objects.rend()) - 1; } |