Răsfoiți Sursa

Kernel/Semaphore: Fixed a regression in semaphore waits.

The regression was caused by a missing check in #2260.

The new behavior is consistent with the real kernel.
Subv 9 ani în urmă
părinte
comite
4251eb26ec
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  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;
 }