Increment wakeupCount when a thread is pending.

It might've been woken up but just not run yet.  That doesn't mean
it should not have wakeupCount incremented.

Fixes Tales of Eternia freezing before world map.
This commit is contained in:
Unknown W. Brackets 2013-04-13 00:35:24 -07:00
parent d586d7ddd2
commit 0ad9658eb2

View File

@ -2238,11 +2238,12 @@ void sceKernelWakeupThread()
Thread *t = kernelObjects.Get<Thread>(uid, error);
if (t)
{
if (t->nt.waitType != WAITTYPE_SLEEP) {
if (!t->isWaitingFor(WAITTYPE_SLEEP, 1)) {
t->nt.wakeupCount++;
DEBUG_LOG(HLE,"sceKernelWakeupThread(%i) - wakeupCount incremented to %i", uid, t->nt.wakeupCount);
RETURN(0);
} else {
VERBOSE_LOG(HLE,"sceKernelWakeupThread(%i) - woke thread at %i", uid, t->nt.wakeupCount);
__KernelResumeThreadFromWait(uid);
}
}
@ -2286,7 +2287,7 @@ static void __KernelSleepThread(bool doCallbacks) {
} else {
VERBOSE_LOG(HLE, "sceKernelSleepThread()");
RETURN(0);
__KernelWaitCurThread(WAITTYPE_SLEEP, 0, 0, 0, doCallbacks, "thread slept");
__KernelWaitCurThread(WAITTYPE_SLEEP, 1, 0, 0, doCallbacks, "thread slept");
}
}