mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 08:31:36 +08:00
px4_getpid: return the taskmap index instead of pthread_self()
this makes it consistent with other functions, like px4_task_spawn_cmd() and px4_task_kill()
This commit is contained in:
@@ -326,7 +326,7 @@ void px4_show_tasks()
|
||||
|
||||
}
|
||||
|
||||
unsigned long px4_getpid()
|
||||
px4_task_t px4_getpid()
|
||||
{
|
||||
pthread_t pid = pthread_self();
|
||||
//
|
||||
@@ -340,10 +340,6 @@ unsigned long px4_getpid()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __PX4_QURT
|
||||
// XXX This doesn't seem to be working on QURT
|
||||
PX4_ERR("px4_getpid() called from unknown thread context!");
|
||||
#endif
|
||||
return ~0;
|
||||
}
|
||||
|
||||
@@ -386,7 +382,7 @@ int px4_sem_timedwait(px4_sem_t *sem, const struct timespec *ts)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int px4_prctl(int option, const char *arg2, unsigned pid)
|
||||
int px4_prctl(int option, const char *arg2, px4_task_t pid)
|
||||
{
|
||||
int rv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user