From 690e52bc345fd692f67b67d56293fff66a36322e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 25 May 2013 23:57:04 -0700 Subject: [PATCH] Make sure we keep the suspend state around. I assume it sticks around in this case. --- Core/HLE/sceKernelThread.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index dbba4c0676..2711f67daf 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1468,7 +1468,7 @@ void __KernelWaitCurThread(WaitType type, SceUID waitID, u32 waitValue, u32 time Thread *thread = __GetCurrentThread(); thread->nt.waitID = waitID; thread->nt.waitType = type; - __KernelChangeThreadState(thread, THREADSTATUS_WAIT); + __KernelChangeThreadState(thread, ThreadStatus(THREADSTATUS_WAIT | (thread->nt.status & THREADSTATUS_SUSPEND))); thread->nt.numReleases++; thread->waitInfo.waitValue = waitValue; thread->waitInfo.timeoutPtr = timeoutPtr; @@ -1495,7 +1495,7 @@ void __KernelWaitCallbacksCurThread(WaitType type, SceUID waitID, u32 waitValue, Thread *thread = __GetCurrentThread(); thread->nt.waitID = waitID; thread->nt.waitType = type; - __KernelChangeThreadState(thread, THREADSTATUS_WAIT); + __KernelChangeThreadState(thread, ThreadStatus(THREADSTATUS_WAIT | (thread->nt.status & THREADSTATUS_SUSPEND))); // TODO: Probably not...? thread->nt.numReleases++; thread->waitInfo.waitValue = waitValue; @@ -2080,7 +2080,7 @@ int sceKernelRotateThreadReadyQueue(int priority) if (cur->nt.currentPriority == priority) { threadReadyQueue.push_back(priority, currentThread); - cur->nt.status = THREADSTATUS_READY; + cur->nt.status = (cur->nt.status & ~THREADSTATUS_RUNNING) | THREADSTATUS_READY; } // Yield the next thread of this priority to all other threads of same priority. else