mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 05:53:35 +08:00
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:
+4
-1
@@ -29,7 +29,10 @@ private:
|
|||||||
// This destructor gets called as part of thread-local storage cleanup.
|
// 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,
|
// This is really only a work-around for non-proper thread stopping. Note that we also assume,
|
||||||
// that we can still access the mutex.
|
// that we can still access the mutex.
|
||||||
pthread_mutex_unlock(passed_lock);
|
if (passed_lock) {
|
||||||
|
pthread_mutex_unlock(passed_lock);
|
||||||
|
}
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user