From 4251eb26eca3f6df8360f9b6aa6762340817c48a Mon Sep 17 00:00:00 2001
From: Subv <subv2112@gmail.com>
Date: Sun, 1 Jan 2017 19:07:37 -0500
Subject: [PATCH] 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.
---
 src/core/hle/kernel/semaphore.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
index 5e6139265d..8bda2f75df 100644
--- a/src/core/hle/kernel/semaphore.cpp
+++ b/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;
 }