mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 06:39:25 +08:00
76fbac4dee
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.