Core: Fix exiting rewind thread

This commit is contained in:
Vicki Pfau 2017-07-11 23:01:47 -07:00
parent 055ba3df63
commit cb7b819fe3
1 changed files with 4 additions and 2 deletions

View File

@ -157,10 +157,12 @@ THREAD_ENTRY _rewindThread(void* 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);