summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_condition_variable.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-03-08 02:48:46 +0100
committerLiam <byteslice@airmail.cc>2023-03-08 02:51:29 +0100
commit1776448df2a023f6735b69e27b72664e02f448ee (patch)
tree51af858c5e60d432db36d876f1d791aded1115c9 /src/core/hle/kernel/k_condition_variable.cpp
parentMerge pull request #9889 from Morph1984/time-is-ticking (diff)
downloadyuzu-1776448df2a023f6735b69e27b72664e02f448ee.tar
yuzu-1776448df2a023f6735b69e27b72664e02f448ee.tar.gz
yuzu-1776448df2a023f6735b69e27b72664e02f448ee.tar.bz2
yuzu-1776448df2a023f6735b69e27b72664e02f448ee.tar.lz
yuzu-1776448df2a023f6735b69e27b72664e02f448ee.tar.xz
yuzu-1776448df2a023f6735b69e27b72664e02f448ee.tar.zst
yuzu-1776448df2a023f6735b69e27b72664e02f448ee.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_condition_variable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_condition_variable.cpp b/src/core/hle/kernel/k_condition_variable.cpp
index f40cf92b1..458f4c94e 100644
--- a/src/core/hle/kernel/k_condition_variable.cpp
+++ b/src/core/hle/kernel/k_condition_variable.cpp
@@ -266,11 +266,12 @@ void KConditionVariable::Signal(u64 cv_key, s32 count) {
Result KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout) {
// Prepare to wait.
KThread* cur_thread = GetCurrentThreadPointer(kernel);
+ KHardwareTimer* timer{};
ThreadQueueImplForKConditionVariableWaitConditionVariable wait_queue(
kernel, std::addressof(thread_tree));
{
- KScopedSchedulerLockAndSleep slp(kernel, cur_thread, timeout);
+ KScopedSchedulerLockAndSleep slp(kernel, std::addressof(timer), cur_thread, timeout);
// Check that the thread isn't terminating.
if (cur_thread->IsTerminationRequested()) {
@@ -320,6 +321,7 @@ Result KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout) {
thread_tree.insert(*cur_thread);
// Begin waiting.
+ wait_queue.SetHardwareTimer(timer);
cur_thread->BeginWait(std::addressof(wait_queue));
cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::ConditionVar);
cur_thread->SetMutexWaitAddressForDebugging(addr);