Move running thread resched to __KernelNextThread.

Pretty sure this is needed, but apparently it breaks Sol Trigger.
This commit is contained in:
Unknown W. Brackets committed 2013-02-11 01:27:07 -08:00
1 parent fd1c686edf
commit 9a5589a180
1 file changed
+5 -4
+5 -4
View File
@@ -1157,6 +1157,10 @@ u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason, bo
}
Thread *__KernelNextThread() {
// If the current thread is running, it's a valid candidate.
if (__GetCurrentThread() && __GetCurrentThread()->isRunning())
__KernelChangeReadyState(currentThread, true);
SceUID bestThread = -1;
// This goes in priority order.
for (auto it = threadReadyQueue.begin(), end = threadReadyQueue.end(); it != end; ++it)
@@ -1199,10 +1203,6 @@ void __KernelReSchedule(const char *reason)
return;
}
// TODO: Not sure if this is correct? Probably should remove.
if (__GetCurrentThread() && __GetCurrentThread()->isRunning())
__KernelChangeReadyState(currentThread, true);
retry:
Thread *nextThread = __KernelNextThread();
@@ -2289,6 +2289,7 @@ void __KernelSwitchContext(Thread *target, const char *reason)
if (DEBUG_LEVEL <= MAX_LOGLEVEL)
oldName = cur->GetName();
// Normally this is taken care of in __KernelNextThread().
if (cur->isRunning())
__KernelChangeReadyState(cur, oldUID, true);
}