From 7530a0b6fd95997422b29e60d5eacdc9d1ad8742 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 2 Feb 2013 19:48:23 -0800 Subject: [PATCH] When creating threads, etc. restore thread ready. The old thread was sticking in the RUNNING state. --- Core/HLE/sceKernelThread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 8a19392b6c..d2fb9ec04e 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2233,7 +2233,13 @@ void __KernelSwitchContext(Thread *target, const char *reason) // Profile on Windows shows this takes time, skip it. if (DEBUG_LEVEL <= MAX_LOGLEVEL) oldName = cur->GetName(); + + if (cur->isRunning()) + cur->nt.status = (cur->nt.status | THREADSTATUS_READY) & ~THREADSTATUS_RUNNING; } + if (target && target->isRunning()) + cur->nt.status = (cur->nt.status | THREADSTATUS_RUNNING) & ~THREADSTATUS_READY; + currentThread = target->GetUID(); __KernelLoadContext(&target->context); DEBUG_LOG(HLE,"Context switched: %s -> %s (%s) (%i - pc: %08x -> %i - pc: %08x)",