Explorar o código

Merge pull request #2396 from Subv/sema_acquire

Kernel/Semaphore: Fixed a regression in semaphore waits.
bunnei %!s(int64=9) %!d(string=hai) anos
pai
achega
59f4f1d7ff
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/core/hle/kernel/semaphore.cpp

+ 2 - 1
src/core/hle/kernel/semaphore.cpp

@@ -35,7 +35,8 @@ bool Semaphore::ShouldWait(Thread* thread) const {
 }
 
 void Semaphore::Acquire(Thread* thread) {
-    ASSERT_MSG(!ShouldWait(thread), "object unavailable!");
+    if (available_count <= 0)
+        return;
     --available_count;
 }