Semaphores always wait when others are waiting.

This commit is contained in:
Unknown W. Brackets committed 2013-03-24 21:56:05 -07:00
1 parent 783df9f0c3
commit 3b452e970d
1 file changed
+2 -2
+2 -2
View File
@@ -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;