summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_synchronization_object.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-20 06:05:24 +0100
committerbunnei <bunneidev@gmail.com>2021-01-29 06:42:26 +0100
commitc0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b (patch)
treee138e7d0ecb6a306261e2871fd0da405571deaab /src/core/hle/kernel/k_synchronization_object.cpp
parentcommon: common_funcs: Add useful kernel macro R_SUCCEED_IF. (diff)
downloadyuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar
yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.gz
yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.bz2
yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.lz
yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.xz
yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.zst
yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_synchronization_object.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/hle/kernel/k_synchronization_object.cpp b/src/core/hle/kernel/k_synchronization_object.cpp
index 18e7026f5..a3b34f82f 100644
--- a/src/core/hle/kernel/k_synchronization_object.cpp
+++ b/src/core/hle/kernel/k_synchronization_object.cpp
@@ -21,11 +21,10 @@ ResultCode KSynchronizationObject::Wait(KernelCore& kernel, s32* out_index,
// Prepare for wait.
KThread* thread = kernel.CurrentScheduler()->GetCurrentThread();
- Handle timer = InvalidHandle;
{
// Setup the scheduling lock and sleep.
- KScopedSchedulerLockAndSleep slp(kernel, timer, thread, timeout);
+ KScopedSchedulerLockAndSleep slp{kernel, thread, timeout};
// Check if any of the objects are already signaled.
for (auto i = 0; i < num_objects; ++i) {
@@ -90,10 +89,7 @@ ResultCode KSynchronizationObject::Wait(KernelCore& kernel, s32* out_index,
thread->SetWaitObjectsForDebugging({});
// Cancel the timer as needed.
- if (timer != InvalidHandle) {
- auto& time_manager = kernel.TimeManager();
- time_manager.UnscheduleTimeEvent(timer);
- }
+ kernel.TimeManager().UnscheduleTimeEvent(thread);
// Get the wait result.
ResultCode wait_result{RESULT_SUCCESS};