mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-25 01:00:01 +00:00
Return a negative error code in __KernelGetWaitID.
This way we can use 0 as a proper wait id.
This commit is contained in:
parent
2577f65b80
commit
ccf021cef0
@ -1393,7 +1393,7 @@ SceUID __KernelGetWaitID(SceUID threadID, WaitType type, u32 &error)
|
||||
else
|
||||
{
|
||||
ERROR_LOG(SCEKERNEL, "__KernelGetWaitID ERROR: thread %i", threadID);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2587,7 +2587,7 @@ int sceKernelWakeupThread(SceUID uid)
|
||||
Thread *t = kernelObjects.Get<Thread>(uid, error);
|
||||
if (t)
|
||||
{
|
||||
if (!t->isWaitingFor(WAITTYPE_SLEEP, 1)) {
|
||||
if (!t->isWaitingFor(WAITTYPE_SLEEP, 0)) {
|
||||
t->nt.wakeupCount++;
|
||||
DEBUG_LOG(SCEKERNEL,"sceKernelWakeupThread(%i) - wakeupCount incremented to %i", uid, t->nt.wakeupCount);
|
||||
} else {
|
||||
@ -2633,7 +2633,7 @@ static int __KernelSleepThread(bool doCallbacks) {
|
||||
DEBUG_LOG(SCEKERNEL, "sceKernelSleepThread() - wakeupCount decremented to %i", thread->nt.wakeupCount);
|
||||
} else {
|
||||
VERBOSE_LOG(SCEKERNEL, "sceKernelSleepThread()");
|
||||
__KernelWaitCurThread(WAITTYPE_SLEEP, 1, 0, 0, doCallbacks, "thread slept");
|
||||
__KernelWaitCurThread(WAITTYPE_SLEEP, 0, 0, 0, doCallbacks, "thread slept");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user