lockstep_scheduler: check if mutex is still valid

It turns out that we can fix the unit tests of the lockstep_scheduler
just by checking if `passed_lock` is not `nullptr`.

Without this check, the unit tests segfaulted.
This commit is contained in:
Julian Oes 2019-03-15 13:15:39 +01:00 committed by Beat Küng
parent 2ebb9d2ab5
commit b54ca67de9
1 changed files with 4 additions and 1 deletions

View File

@ -29,7 +29,10 @@ private:
// This destructor gets called as part of thread-local storage cleanup.
// This is really only a work-around for non-proper thread stopping. Note that we also assume,
// that we can still access the mutex.
pthread_mutex_unlock(passed_lock);
if (passed_lock) {
pthread_mutex_unlock(passed_lock);
}
done = true;
}