summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-10-22 01:18:38 +0200
committerLiam <byteslice@airmail.cc>2023-10-22 02:03:41 +0200
commitdcfe674ed4eef3879f0ed8706507ea21d13aab24 (patch)
treeefffa461332fc9ecec4c13ef555459379c0ddc41
parentkernel: add missing TLR clear (diff)
downloadyuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.tar
yuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.tar.gz
yuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.tar.bz2
yuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.tar.lz
yuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.tar.xz
yuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.tar.zst
yuzu-dcfe674ed4eef3879f0ed8706507ea21d13aab24.zip
-rw-r--r--src/core/hle/kernel/k_thread.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index ac0f215d7..a6deb50ec 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -415,10 +415,6 @@ void KThread::StartTermination() {
m_parent->ClearRunningThread(this);
}
- // Signal.
- m_signaled = true;
- KSynchronizationObject::NotifyAvailable();
-
// Clear previous thread in KScheduler.
KScheduler::ClearPreviousThread(m_kernel, this);
@@ -437,6 +433,13 @@ void KThread::FinishTermination() {
}
}
+ // Acquire the scheduler lock.
+ KScopedSchedulerLock sl{m_kernel};
+
+ // Signal.
+ m_signaled = true;
+ KSynchronizationObject::NotifyAvailable();
+
// Close the thread.
this->Close();
}