summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-11-23 13:24:39 -0500
committerGravatar GitHub2019-11-23 13:24:39 -0500
commit6a3fc5d2ff2732e0392db56b04ff0c4e2c167bf2 (patch)
tree7d8189083964982abf5e48e3dd8e87e504ca7ab6 /src/core/hle/kernel/kernel.cpp
parentMerge pull request #3141 from ReinUsesLisp/gl-position (diff)
parentKernel: Optimize condition variable threads management. (diff)
downloadyuzu-6a3fc5d2ff2732e0392db56b04ff0c4e2c167bf2.tar.gz
yuzu-6a3fc5d2ff2732e0392db56b04ff0c4e2c167bf2.tar.xz
yuzu-6a3fc5d2ff2732e0392db56b04ff0c4e2c167bf2.zip
Merge pull request #3114 from FernandoS27/cond-var
Kernel: Correct behavior of Condition Variables to be more similar to real hardware.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index f94ac150d..9d3b309b3 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -64,8 +64,11 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] s64 cycles_
64 } else if (thread->GetStatus() == ThreadStatus::WaitMutex || 64 } else if (thread->GetStatus() == ThreadStatus::WaitMutex ||
65 thread->GetStatus() == ThreadStatus::WaitCondVar) { 65 thread->GetStatus() == ThreadStatus::WaitCondVar) {
66 thread->SetMutexWaitAddress(0); 66 thread->SetMutexWaitAddress(0);
67 thread->SetCondVarWaitAddress(0);
68 thread->SetWaitHandle(0); 67 thread->SetWaitHandle(0);
68 if (thread->GetStatus() == ThreadStatus::WaitCondVar) {
69 thread->GetOwnerProcess()->RemoveConditionVariableThread(thread);
70 thread->SetCondVarWaitAddress(0);
71 }
69 72
70 auto* const lock_owner = thread->GetLockOwner(); 73 auto* const lock_owner = thread->GetLockOwner();
71 // Threads waking up by timeout from WaitProcessWideKey do not perform priority inheritance 74 // Threads waking up by timeout from WaitProcessWideKey do not perform priority inheritance