mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Fix return value bug in px4_task_spawn_internal returning the arg-parsing loop variable instead of the task index. Add pthread_attr_destroy calls to prevent resource leaks on task creation failure, deletion, and exit. Fix race condition in px4_task_delete by unlocking the mutex before pthread_join and properly joining after pthread_cancel. Fix mutex unlock placement in px4_task_exit to only unlock when the mutex was acquired.