summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-10 23:29:02 +0100
committerbunnei <bunneidev@gmail.com>2021-01-11 23:23:17 +0100
commit03dfc8d8e74910d447b755e00848a623ec65cd93 (patch)
tree56a80760bd0ba8ecd85dc8d9f09fb9e2068c91d4 /src/core/hle/kernel/thread.cpp
parentyuzu: debugger: wait_tree: Handle unknown ThreadState. (diff)
downloadyuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar
yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.gz
yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.bz2
yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.lz
yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.xz
yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.zst
yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.zip
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index eda56c31c..d97323255 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -215,7 +215,10 @@ VAddr Thread::GetCommandBufferAddress() const {
void Thread::SetState(ThreadState state) {
KScopedSchedulerLock sl(kernel);
- SetMutexWaitAddressForDebugging(0);
+ // Clear debugging state
+ SetMutexWaitAddressForDebugging({});
+ SetWaitReasonForDebugging({});
+
const ThreadState old_state = thread_state;
thread_state =
static_cast<ThreadState>((old_state & ~ThreadState::Mask) | (state & ThreadState::Mask));
@@ -386,6 +389,7 @@ ResultCode Thread::Sleep(s64 nanoseconds) {
{
KScopedSchedulerLockAndSleep lock(kernel, event_handle, this, nanoseconds);
SetState(ThreadState::Waiting);
+ SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Sleep);
}
if (event_handle != InvalidHandle) {