Resume dispatch on thread start.

This commit is contained in:
Unknown W. Brackets
2013-03-24 20:52:18 -07:00
parent c9e1b01545
commit 64445e0c8d
+12 -2
View File
@@ -26,8 +26,9 @@
#include "../MIPS/MIPSInt.h"
#include "../MIPS/MIPSCodeUtils.h"
#include "../MIPS/MIPS.h"
#include "../../Core/CoreTiming.h"
#include "../../Core/MemMap.h"
#include "Core/CoreTiming.h"
#include "Core/MemMap.h"
#include "Core/Reporting.h"
#include "ChunkFile.h"
#include "sceAudio.h"
@@ -1565,9 +1566,18 @@ int sceKernelStartThread(SceUID threadToStartID, u32 argSize, u32 argBlockPtr)
// Smaller is better for priority. Only switch if the new thread is better.
if (cur && cur->nt.currentPriority > startThread->nt.currentPriority)
{
// Starting a thread automatically resumes the dispatch thread.
// TODO: Maybe this happens even for worse-priority started threads?
dispatchEnabled = true;
__KernelChangeReadyState(currentThread, true);
hleReSchedule("thread started");
}
else if (!dispatchEnabled)
{
WARN_LOG(HLE, "UNTESTED Dispatch disabled while starting worse-priority thread");
Reporting::ReportMessage("UNTESTED Dispatch disabled while starting worse-priority thread");
}
__KernelChangeReadyState(startThread, threadToStartID, true);
return 0;
}