From 8df298f622d4cb367ac4e8efc36a9a4bdf003f48 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 30 May 2016 20:07:28 -0700 Subject: [PATCH] Thread: Auto-resume dispatch for worse threads. Seems this doesn't happen when you start a better priority thread, pretty reproducibly. --- Core/HLE/sceKernelThread.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 146d696768..517330108e 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2015,8 +2015,11 @@ int __KernelStartThread(SceUID threadToStartID, int argSize, u32 argBlockPtr, bo hleReSchedule("thread started"); } - // Starting a thread automatically resumes the dispatch thread. - dispatchEnabled = true; + // Starting a thread automatically resumes the dispatch thread if the new thread has worse priority. + // Seems strange but also seems reproducible. + if (cur && cur->nt.currentPriority <= startThread->nt.currentPriority) { + dispatchEnabled = true; + } __KernelChangeReadyState(startThread, threadToStartID, true);