aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_address_arbiter.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-03-07 20:48:46 -0500
committerLiam <byteslice@airmail.cc>2023-03-07 20:51:29 -0500
commit1776448df2a023f6735b69e27b72664e02f448ee (patch)
tree51af858c5e60d432db36d876f1d791aded1115c9 /src/core/hle/kernel/k_address_arbiter.cpp
parenta7792e5ff83523142230951ac7eacbd7685dc40b (diff)
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.cpp8
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);
}