diff --git a/CHANGES b/CHANGES index 5a7090f69..0010d8000 100644 --- a/CHANGES +++ b/CHANGES @@ -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 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 diff --git a/src/core/thread.c b/src/core/thread.c index 887b7fa3f..d266ca4a8 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -260,7 +260,10 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) { if (threadContext->run) { threadContext->run(threadContext); } + MutexLock(&threadContext->impl->stateMutex); threadContext->impl->state = threadContext->impl->savedState; + ConditionWake(&threadContext->impl->stateCond); + MutexUnlock(&threadContext->impl->stateMutex); break; case THREAD_RESETING: core->reset(core);