Files
PX4-Autopilot/boards/omnibus/f4sd
Julian Oes 225c1b70ef fix(mavlink): require CONFIG_PTHREAD_MUTEX_TYPES for recursive send mutex
The per-channel send mutex is genuinely recursive: callers hold lock_send()
while the MAVLink C library re-enters send_start()/send_finish() on the same
mutex via MAVLINK_START_UART_SEND. On NuttX a recursive mutex only works with
CONFIG_PTHREAD_MUTEX_TYPES; without it pthread_mutexattr_settype() is a no-op
and the nested lock deadlocks. Only a handful of boards happened to enable the
option (for Zenoh), so mavlink could deadlock at startup on most boards, e.g.
when bringing up a USB link.

Enable CONFIG_PTHREAD_MUTEX_TYPES on the NuttX boards that build mavlink, add
a compile-time guard so a board missing the option fails the build loudly
instead of deadlocking silently, and check the settype() return. Enabling the
option is free in flash and RAM on these boards since they already enable
CONFIG_PRIORITY_INHERITANCE / CONFIG_PTHREAD_MUTEX_ROBUST.

Signed-off-by: Julian Oes <julian@oes.ch>
2026-07-06 08:46:35 -07:00
..
2022-11-20 20:28:07 -05:00
2025-01-22 14:46:24 -05:00