Core: Fix threading improperly setting paused state while interrupted

This commit is contained in:
Vicki Pfau 2020-11-14 02:29:39 -08:00
parent a268eb7175
commit f05ba8a35b
2 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Emulation fixes:
- GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring
Other fixes:
- CMake: Fix build with downstream minizip that exports incompatible symbols
- Core: Fix threading improperly setting paused state while interrupted
- Core: Fix thread unsafety issue when dispatching code to a thread
- Debugger: Close trace log when done tracing
- Qt: Fix running proxied video if it gets pushed to the main thread

View File

@ -564,7 +564,10 @@ void mCoreThreadTogglePause(struct mCoreThread* threadContext) {
void mCoreThreadPauseFromThread(struct mCoreThread* threadContext) {
bool frameOn = true;
MutexLock(&threadContext->impl->stateMutex);
if (threadContext->impl->state == THREAD_RUNNING || (threadContext->impl->interruptDepth && threadContext->impl->savedState == THREAD_RUNNING)) {
if (threadContext->impl->interruptDepth && threadContext->impl->savedState == THREAD_RUNNING) {
threadContext->impl->savedState = THREAD_PAUSING;
frameOn = false;
} else if (threadContext->impl->state == THREAD_RUNNING) {
threadContext->impl->state = THREAD_PAUSING;
frameOn = false;
}