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 | 92c89312fcfe75d030de9e7bced94bc70dcba00b (patch) | |
| tree | 2bdc9dcf0a110c0df5f0f4a78904bdcebe42a31f /src/core/hle/kernel/k_address_arbiter.cpp | |
| parent | e0bd27b674f961d16e8ac4ba9d125b69d080800d (diff) | |
| parent | 1776448df2a023f6735b69e27b72664e02f448ee (diff) | |
Merge pull request #9923 from liamwhite/kht
kernel: add timer pointer to KThreadQueue
Diffstat (limited to 'src/core/hle/kernel/k_address_arbiter.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_address_arbiter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp index fb86451ea..a4c16eca9 100644 --- a/src/core/hle/kernel/k_address_arbiter.cpp +++ b/src/core/hle/kernel/k_address_arbiter.cpp @@ -237,10 +237,11 @@ Result KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32 val Result KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement, s64 timeout) { // Prepare to wait. KThread* cur_thread = GetCurrentThreadPointer(kernel); + KHardwareTimer* timer{}; ThreadQueueImplForKAddressArbiter 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()) { @@ -279,6 +280,7 @@ Result KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement, s6 thread_tree.insert(*cur_thread); // Wait for the thread to finish. + wait_queue.SetHardwareTimer(timer); cur_thread->BeginWait(std::addressof(wait_queue)); cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Arbitration); } @@ -290,10 +292,11 @@ Result KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement, s6 Result KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) { // Prepare to wait. KThread* cur_thread = GetCurrentThreadPointer(kernel); + KHardwareTimer* timer{}; ThreadQueueImplForKAddressArbiter 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()) { @@ -325,6 +328,7 @@ Result KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) { thread_tree.insert(*cur_thread); // Wait for the thread to finish. + wait_queue.SetHardwareTimer(timer); cur_thread->BeginWait(std::addressof(wait_queue)); cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Arbitration); } |
