summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-11-14 20:13:18 -0400
committerGravatar FernandoS272019-11-21 10:46:55 -0400
commit2d16507f9fa06e868349d6f57a78585aec8628fd (patch)
tree7931e2bb9db6d55e7be760f1a1dcff14de09db78 /src/core/hle/kernel/kernel.cpp
parentMerge pull request #3142 from ReinUsesLisp/depbar-log (diff)
downloadyuzu-2d16507f9fa06e868349d6f57a78585aec8628fd.tar.gz
yuzu-2d16507f9fa06e868349d6f57a78585aec8628fd.tar.xz
yuzu-2d16507f9fa06e868349d6f57a78585aec8628fd.zip
Kernel: Correct behavior of Condition Variables to be more similar to real hardware.
This commit ensures cond var threads act exactly as they do in the real console. The original implementation uses an RBTree and the behavior of cond var threads is that at the same priority level they act like a FIFO.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index f94ac150d..cdf7944f7 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -66,6 +66,9 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] s64 cycles_
66 thread->SetMutexWaitAddress(0); 66 thread->SetMutexWaitAddress(0);
67 thread->SetCondVarWaitAddress(0); 67 thread->SetCondVarWaitAddress(0);
68 thread->SetWaitHandle(0); 68 thread->SetWaitHandle(0);
69 if (thread->GetStatus() == ThreadStatus::WaitCondVar) {
70 thread->GetOwnerProcess()->RemoveConditionVariableThread(thread);
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