summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-07-11 21:10:01 +0200
committerGitHub <noreply@github.com>2022-07-11 21:10:01 +0200
commit802bbb226389c073cc82821b021a7b1209c5f12f (patch)
treeb3f05ee2e071cd77dd1433a86ecf59b10ed24e1c /src/core/hle/kernel
parentMerge pull request #8528 from Morph1984/astc10x6 (diff)
parentkernel: fix usage of waiter_list in Finalize (diff)
downloadyuzu-802bbb226389c073cc82821b021a7b1209c5f12f.tar
yuzu-802bbb226389c073cc82821b021a7b1209c5f12f.tar.gz
yuzu-802bbb226389c073cc82821b021a7b1209c5f12f.tar.bz2
yuzu-802bbb226389c073cc82821b021a7b1209c5f12f.tar.lz
yuzu-802bbb226389c073cc82821b021a7b1209c5f12f.tar.xz
yuzu-802bbb226389c073cc82821b021a7b1209c5f12f.tar.zst
yuzu-802bbb226389c073cc82821b021a7b1209c5f12f.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/k_thread.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 50cb5fc90..90de86770 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -308,14 +308,20 @@ void KThread::Finalize() {
auto it = waiter_list.begin();
while (it != waiter_list.end()) {
- // Clear the lock owner
- it->SetLockOwner(nullptr);
+ // Get the thread.
+ KThread* const waiter = std::addressof(*it);
+
+ // The thread shouldn't be a kernel waiter.
+ ASSERT(!IsKernelAddressKey(waiter->GetAddressKey()));
+
+ // Clear the lock owner.
+ waiter->SetLockOwner(nullptr);
// Erase the waiter from our list.
it = waiter_list.erase(it);
// Cancel the thread's wait.
- it->CancelWait(ResultInvalidState, true);
+ waiter->CancelWait(ResultInvalidState, true);
}
}