forked from Archive/PX4-Autopilot
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:
parent
2ebb9d2ab5
commit
b54ca67de9
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue