From d6048dc646cd6940751ca1bdfdc53fe8a331b6cf Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 9 Nov 2013 22:31:12 -0800 Subject: [PATCH] Don't burn the cpu while idle in multithread. --- Core/System.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/System.cpp b/Core/System.cpp index 81de7a3db5..6c044bf5ce 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -345,6 +345,9 @@ void PSP_RunLoopUntil(u64 globalticks) { // TODO: Something smarter? Or force CPU to bail periodically? while (!CPU_IsReady()) { gpu->RunEventsUntil(CoreTiming::GetTicks() + msToCycles(1000)); + if (coreState != CORE_RUNNING) { + CPU_WaitStatus(cpuThreadReplyCond, &CPU_IsReady); + } } } else { ERROR_LOG(CPU, "Unable to execute CPU run loop, unexpected state: %d", cpuThreadState);