aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_condition_variable.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-19 21:05:24 -0800
committerbunnei <bunneidev@gmail.com>2021-01-28 21:42:26 -0800
commitc0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b (patch)
treee138e7d0ecb6a306261e2871fd0da405571deaab /src/core/hle/kernel/k_condition_variable.cpp
parentbb966d3e336ce1eee86daca5db00b29a63708d4c (diff)
hle: kernel: TimeManager: Simplify to not rely on previous EmuThreadHandle implementation.
Diffstat (limited to 'src/core/hle/kernel/k_condition_variable.cpp')
-rw-r--r--src/core/hle/kernel/k_condition_variable.cpp8
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.
{