Don't schedule a finish event when not running.

Otherwise it'll get it when it does run, and stop early.
This commit is contained in:
Unknown W. Brackets 2013-11-09 21:11:50 -08:00
parent 1633aa689c
commit 113146302b
2 changed files with 6 additions and 2 deletions

View file

@ -344,7 +344,7 @@ void PSP_RunLoopUntil(u64 globalticks) {
// The CPU doesn't actually respect cpuThreadUntil well, especially when skipping frames.
// TODO: Something smarter? Or force CPU to bail periodically?
while (!CPU_IsReady()) {
gpu->RunEventsUntil(CoreTiming::GetTicks() + msToCycles(100));
gpu->RunEventsUntil(CoreTiming::GetTicks() + msToCycles(1000));
}
} else {
ERROR_LOG(CPU, "Unable to execute CPU run loop, unexpected state: %d", cpuThreadState);

View file

@ -130,7 +130,11 @@ struct ThreadEventQueue : public B {
void FinishEventLoop() {
if (threadEnabled_) {
ScheduleEvent(EVENT_FINISH);
lock_guard guard(eventsLock_);
// Don't schedule a finish if it's not even running.
if (eventsRunning_) {
ScheduleEvent(EVENT_FINISH);
}
}
}