Allow semaphores with waiters to signal.

If the max is 1, but there's 1 waiting, it's okay to signal 2.
Really, the final result is what matters.
This commit is contained in:
Unknown W. Brackets 2012-11-27 23:22:49 -08:00
parent 3ab41e515d
commit 7164638799

View file

@ -222,7 +222,7 @@ void sceKernelSignalSema(SceUID id, int signal)
Semaphore *s = kernelObjects.Get<Semaphore>(id, error);
if (s)
{
if (s->ns.currentCount + signal > s->ns.maxCount)
if (s->ns.currentCount + signal - s->ns.numWaitThreads > s->ns.maxCount)
{
RETURN(SCE_KERNEL_ERROR_SEMA_OVF);
return;