From 12005267ac74bcbbb7bb3ab95776d904fd45937c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 5 Jun 2013 23:42:42 -0700 Subject: [PATCH] Reschedule in sceKernelChangeThreadPriority(). Seems like this is another way to yield, makes sense. --- Core/HLE/sceKernelThread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index a248e3c8b1..b57ed41ad1 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2262,6 +2262,7 @@ int sceKernelChangeThreadPriority(SceUID threadID, int priority) { if (threadID == 0) threadID = currentThread; + // 0 means the current (running) thread's priority, not target's. if (priority == 0) { Thread *cur = __GetCurrentThread(); @@ -2287,11 +2288,13 @@ int sceKernelChangeThreadPriority(SceUID threadID, int priority) threadReadyQueue.remove(old, threadID); thread->nt.currentPriority = priority; - threadReadyQueue.prepare(thread->nt.currentPriority); + if (thread->isRunning()) + thread->nt.status = (thread->nt.status & ~THREADSTATUS_RUNNING) | THREADSTATUS_READY; if (thread->isReady()) threadReadyQueue.push_back(thread->nt.currentPriority, threadID); + hleReSchedule("change thread priority"); return 0; } else