mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 10:13:43 +01:00
Semaphores always wait when others are waiting.
This commit is contained in:
1 parent
783df9f0c3
commit
3b452e970d
1 file changed
+2
-2
@@ -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<Semaphore>(id, error);
|
||||
if (s)
|
||||
{
|
||||
if (s->ns.currentCount >= wantedCount)
|
||||
if (s->ns.currentCount >= wantedCount && s->ns.numWaitThreads == 0)
|
||||
{
|
||||
s->ns.currentCount -= wantedCount;
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user