From 6643673f28b9273149fc945849a13ed832e9ef33 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 18 Jan 2015 01:27:46 -0500 Subject: WaitSynchronizationN: Refactor to fix several bugs - Separate wait checking from waiting the current thread - Resume thread when wait_all=true only if all objects are available at once - Set output to correct wait object index when there are duplicate handles --- src/core/hle/kernel/semaphore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel/semaphore.cpp') diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 6464b2580..42b5cf704 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp @@ -32,11 +32,11 @@ public: return available_count > 0; } - ResultVal Wait(unsigned index) override { + ResultVal Wait(bool wait_thread) override { bool wait = !IsAvailable(); - if (wait) { - Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_SEMA, this, index); + if (wait && wait_thread) { + Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_SEMA, this); AddWaitingThread(GetCurrentThread()); } -- cgit v1.2.3