mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 16:23:34 +08:00
lockstep_scheduler: avoid pthread_cond_destroy on at_exit
The static object is destroyed on at_exit while threads might still be inside a CS. This can lead to a hanging process. Cleaner would be to gracefully stop the threads. According to https://linux.die.net/man/3/pthread_cond_destroy: Attempting to destroy a condition variable upon which other threads are currently blocked results in undefined behavior.
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
|
||||
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
#include <lockstep_scheduler/lockstep_scheduler.h>
|
||||
static LockstepScheduler lockstep_scheduler {};
|
||||
static LockstepScheduler lockstep_scheduler {true};
|
||||
#endif
|
||||
|
||||
// Intervals in usec
|
||||
|
||||
Reference in New Issue
Block a user