all repos — mgba @ cb7b819fe3ecdbe1a9ff06c0dd3650a49514a191

mGBA Game Boy Advance Emulator

Core: Fix exiting rewind thread
Vicki Pfau vi@endrift.com
Tue, 11 Jul 2017 23:01:47 -0700
commit

cb7b819fe3ecdbe1a9ff06c0dd3650a49514a191

parent

055ba3df630c46d6c07355ef8bcfeb59fb36b5aa

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M src/core/rewind.csrc/core/rewind.c

@@ -157,10 +157,12 @@ struct mCoreRewindContext* rewindContext = context;

ThreadSetName("Rewind Diff Thread"); MutexLock(&rewindContext->mutex); while (rewindContext->onThread) { - while (!rewindContext->ready) { + while (!rewindContext->ready && rewindContext->onThread) { ConditionWait(&rewindContext->cond, &rewindContext->mutex); } - _rewindDiff(rewindContext); + if (rewindContext->ready) { + _rewindDiff(rewindContext); + } rewindContext->ready = false; } MutexUnlock(&rewindContext->mutex);