diff options
| author | Liam <byteslice@airmail.cc> | 2023-03-07 20:48:46 -0500 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2023-03-07 20:51:29 -0500 |
| commit | 1776448df2a023f6735b69e27b72664e02f448ee (patch) | |
| tree | 51af858c5e60d432db36d876f1d791aded1115c9 /src/core/hle/kernel/k_synchronization_object.cpp | |
| parent | a7792e5ff83523142230951ac7eacbd7685dc40b (diff) | |
kernel: add timer pointer to KThreadQueue
Diffstat (limited to 'src/core/hle/kernel/k_synchronization_object.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_synchronization_object.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_synchronization_object.cpp b/src/core/hle/kernel/k_synchronization_object.cpp index 802dca046..40fd0c038 100644 --- a/src/core/hle/kernel/k_synchronization_object.cpp +++ b/src/core/hle/kernel/k_synchronization_object.cpp @@ -79,12 +79,13 @@ Result KSynchronizationObject::Wait(KernelCore& kernel_ctx, s32* out_index, // Prepare for wait. KThread* thread = GetCurrentThreadPointer(kernel_ctx); + KHardwareTimer* timer{}; ThreadQueueImplForKSynchronizationObjectWait wait_queue(kernel_ctx, objects, thread_nodes.data(), num_objects); { // Setup the scheduling lock and sleep. - KScopedSchedulerLockAndSleep slp(kernel_ctx, thread, timeout); + KScopedSchedulerLockAndSleep slp(kernel_ctx, std::addressof(timer), thread, timeout); // Check if the thread should terminate. if (thread->IsTerminationRequested()) { @@ -131,6 +132,7 @@ Result KSynchronizationObject::Wait(KernelCore& kernel_ctx, s32* out_index, thread->SetSyncedIndex(-1); // Wait for an object to be signaled. + wait_queue.SetHardwareTimer(timer); thread->BeginWait(std::addressof(wait_queue)); thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Synchronization); } |
