From 3b452e970d5a8df335222c87f84681db1e238fd2 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Mar 2013 21:20:36 -0700 Subject: [PATCH] Semaphores always wait when others are waiting. --- Core/HLE/sceKernelSemaphore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceKernelSemaphore.cpp b/Core/HLE/sceKernelSemaphore.cpp index 3adad46b16..3f78646ed0 100644 --- a/Core/HLE/sceKernelSemaphore.cpp +++ b/Core/HLE/sceKernelSemaphore.cpp @@ -329,7 +329,7 @@ int __KernelWaitSema(SceUID id, int wantedCount, u32 timeoutPtr, const char *bad if (wantedCount > s->ns.maxCount || wantedCount <= 0) return SCE_KERNEL_ERROR_ILLEGAL_COUNT; - if (s->ns.currentCount >= wantedCount) + if (s->ns.currentCount >= wantedCount && s->ns.numWaitThreads == 0) { s->ns.currentCount -= wantedCount; if (processCallbacks) @@ -382,7 +382,7 @@ int sceKernelPollSema(SceUID id, int wantedCount) Semaphore *s = kernelObjects.Get(id, error); if (s) { - if (s->ns.currentCount >= wantedCount) + if (s->ns.currentCount >= wantedCount && s->ns.numWaitThreads == 0) { s->ns.currentCount -= wantedCount; return 0;