mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 04:00:34 +08:00
64ddfebfc6
Split set_absolute_time() into two phases: iterate the waiter list under _timed_waits_mutex, then broadcast under a separate _broadcast_mutex. This eliminates the lock-order-inversion cycle between cond_timedwait() (holds passed_lock -> acquires _timed_waits_mutex) and set_absolute_time() (held _timed_waits_mutex -> acquired passed_lock). Fix tests to have each thread lock its own mutex before calling cond_timedwait, as required by POSIX (the calling thread must own the mutex passed to pthread_cond_wait). The previous cross-thread ownership caused TSAN's deadlock detector to overflow its 64-entry limit.