Core: Fix exiting rewind thread
Vicki Pfau vi@endrift.com
Tue, 11 Jul 2017 23:01:47 -0700
1 files changed,
4 insertions(+),
2 deletions(-)
jump to
M
src/core/rewind.c
→
src/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);