all repos — mgba @ 7d6b0a30265a8142540b4ac5afcfae2e44704761

mGBA Game Boy Advance Emulator

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

7d6b0a30265a8142540b4ac5afcfae2e44704761

parent

807e289ab3e18787509725aebbd4317575223c6d

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);