Reschedule instead of switching to delayed threads.

This will hopefully take care of #5263, and might fix other issues too.
If a thread goes into a wait, it may reschedule right into an interrupt.

In this case, it would've been switched back to, and woken up early.
This commit is contained in:
Unknown W. Brackets 2014-01-28 22:10:28 -08:00
parent 3249a9abf7
commit c9b037815f

View file

@ -1361,8 +1361,11 @@ bool __KernelSwitchToThread(SceUID threadID, const char *reason)
u32 error;
Thread *t = kernelObjects.Get<Thread>(threadID, error);
if (!t)
ERROR_LOG(SCEKERNEL, "__KernelSwitchToThread: %x doesn't exist", threadID)
else
{
ERROR_LOG_REPORT(SCEKERNEL, "__KernelSwitchToThread: %x doesn't exist", threadID);
hleReSchedule("switch to deleted thread");
}
else if (t->isReady() || t->isRunning())
{
Thread *current = __GetCurrentThread();
if (current && current->isRunning())
@ -1371,6 +1374,10 @@ bool __KernelSwitchToThread(SceUID threadID, const char *reason)
__KernelSwitchContext(t, reason);
return true;
}
else
{
hleReSchedule("switch to waiting thread");
}
return false;
}