Core: Fix some mutex ordering

This commit is contained in:
Vicki Pfau 2024-04-04 00:28:58 -07:00
parent b5a2f62c88
commit 104d746c1e
1 changed files with 3 additions and 3 deletions

View File

@ -433,13 +433,13 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
threadContext->run(threadContext); threadContext->run(threadContext);
} }
} }
MutexLock(&impl->stateMutex);
} }
while (impl->state < mTHREAD_SHUTDOWN) { if (impl->state < mTHREAD_SHUTDOWN) {
MutexLock(&impl->stateMutex);
impl->state = mTHREAD_SHUTDOWN; impl->state = mTHREAD_SHUTDOWN;
MutexUnlock(&impl->stateMutex);
} }
MutexUnlock(&impl->stateMutex);
if (core->opts.rewindEnable) { if (core->opts.rewindEnable) {
mCoreRewindContextDeinit(&impl->rewind); mCoreRewindContextDeinit(&impl->rewind);