When starting a thread, put old thread at end.

This matters so the right thread is run later when scheduling switches
back.
This commit is contained in:
Unknown W. Brackets 2013-03-31 09:45:41 -07:00
parent 0fd3dfb160
commit 2a9c640739

View file

@ -1614,7 +1614,9 @@ int sceKernelStartThread(SceUID threadToStartID, u32 argSize, u32 argBlockPtr)
// TODO: Maybe this happens even for worse-priority started threads?
dispatchEnabled = true;
__KernelChangeReadyState(currentThread, true);
if (cur && cur->isRunning())
cur->nt.status &= ~THREADSTATUS_RUNNING;
__KernelChangeReadyState(cur, currentThread, true);
hleReSchedule("thread started");
}
else if (!dispatchEnabled)