Don't burn the cpu while idle in multithread.

This commit is contained in:
Unknown W. Brackets 2013-11-09 22:31:12 -08:00
parent 92d5643423
commit d6048dc646

View file

@ -345,6 +345,9 @@ void PSP_RunLoopUntil(u64 globalticks) {
// TODO: Something smarter? Or force CPU to bail periodically? // TODO: Something smarter? Or force CPU to bail periodically?
while (!CPU_IsReady()) { while (!CPU_IsReady()) {
gpu->RunEventsUntil(CoreTiming::GetTicks() + msToCycles(1000)); gpu->RunEventsUntil(CoreTiming::GetTicks() + msToCycles(1000));
if (coreState != CORE_RUNNING) {
CPU_WaitStatus(cpuThreadReplyCond, &CPU_IsReady);
}
} }
} else { } else {
ERROR_LOG(CPU, "Unable to execute CPU run loop, unexpected state: %d", cpuThreadState); ERROR_LOG(CPU, "Unable to execute CPU run loop, unexpected state: %d", cpuThreadState);