Skip to content
Snippets Groups Projects
Commit b54ca67d authored by Julian Oes's avatar Julian Oes Committed by Beat Küng
Browse files

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.
parent 2ebb9d2a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment