diff options
author | bunnei <bunneidev@gmail.com> | 2021-01-20 06:05:24 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-01-29 06:42:26 +0100 |
commit | c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b (patch) | |
tree | e138e7d0ecb6a306261e2871fd0da405571deaab /src/core/hle/kernel/k_condition_variable.cpp | |
parent | common: common_funcs: Add useful kernel macro R_SUCCEED_IF. (diff) | |
download | yuzu-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_condition_variable.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/hle/kernel/k_condition_variable.cpp b/src/core/hle/kernel/k_condition_variable.cpp index 2fa2d5289..f0ad8b390 100644 --- a/src/core/hle/kernel/k_condition_variable.cpp +++ b/src/core/hle/kernel/k_condition_variable.cpp @@ -258,10 +258,9 @@ void KConditionVariable::Signal(u64 cv_key, s32 count) { ResultCode KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout) { // Prepare to wait. KThread* cur_thread = kernel.CurrentScheduler()->GetCurrentThread(); - Handle timer = InvalidHandle; { - KScopedSchedulerLockAndSleep slp(kernel, timer, cur_thread, timeout); + KScopedSchedulerLockAndSleep slp{kernel, cur_thread, timeout}; // Set the synced object. cur_thread->SetSyncedObject(nullptr, Svc::ResultTimedOut); @@ -322,10 +321,7 @@ ResultCode KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout) } // Cancel the timer wait. - if (timer != InvalidHandle) { - auto& time_manager = kernel.TimeManager(); - time_manager.UnscheduleTimeEvent(timer); - } + kernel.TimeManager().UnscheduleTimeEvent(cur_thread); // Remove from the condition variable. { |