mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 23:53:34 +08:00
uORB: join threads in unit tests
This commit is contained in:
@@ -274,6 +274,21 @@ px4_task_t px4_task_spawn_cmd(const char *name, int scheduler, int priority, int
|
||||
return taskid;
|
||||
}
|
||||
|
||||
int px4_task_join(px4_task_t id)
|
||||
{
|
||||
if (id < PX4_MAX_TASKS) {
|
||||
pthread_mutex_lock(&task_mutex);
|
||||
pthread_t pid = taskmap[id].pid;
|
||||
pthread_mutex_unlock(&task_mutex);
|
||||
|
||||
if (pid != 0) {
|
||||
return pthread_join(pid, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
int px4_task_delete(px4_task_t id)
|
||||
{
|
||||
int rv = 0;
|
||||
|
||||
Reference in New Issue
Block a user