diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-10 16:19:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-10 16:19:41 -0500 |
| commit | e70d58089730e57c55a8dc8e4a4d21bcca1cd765 (patch) | |
| tree | 2bdc9dcf0a110c0df5f0f4a78904bdcebe42a31f /src/core/hle/kernel/k_condition_variable.cpp | |
| parent | a15a1c385640a86e0060e3d5cdc3206f254a56a2 (diff) | |
| parent | 46a6277709f4c9c33a7962bae800b9c83166d8f9 (diff) | |
Merge pull request #9923 from liamwhite/kht
kernel: add timer pointer to KThreadQueue
Diffstat (limited to 'src/core/hle/kernel/k_condition_variable.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_condition_variable.cpp | 4 |
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 f40cf92b18..458f4c94ea 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); |
