mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
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:
parent
3249a9abf7
commit
c9b037815f
1 changed files with 9 additions and 2 deletions
|
@ -1361,8 +1361,11 @@ bool __KernelSwitchToThread(SceUID threadID, const char *reason)
|
||||||
u32 error;
|
u32 error;
|
||||||
Thread *t = kernelObjects.Get<Thread>(threadID, error);
|
Thread *t = kernelObjects.Get<Thread>(threadID, error);
|
||||||
if (!t)
|
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();
|
Thread *current = __GetCurrentThread();
|
||||||
if (current && current->isRunning())
|
if (current && current->isRunning())
|
||||||
|
@ -1371,6 +1374,10 @@ bool __KernelSwitchToThread(SceUID threadID, const char *reason)
|
||||||
__KernelSwitchContext(t, reason);
|
__KernelSwitchContext(t, reason);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hleReSchedule("switch to waiting thread");
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue