mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-30 12:44:08 +08:00
Work threads: Ensure they have proper names
This commit is contained in:
parent
85079125f4
commit
79a030ec50
@ -195,7 +195,7 @@ void work_queues_init(void)
|
||||
#endif
|
||||
|
||||
// Create high priority worker thread
|
||||
g_work[HPWORK].pid = px4_task_spawn_cmd("wkr_high",
|
||||
g_work[HPWORK].pid = px4_task_spawn_cmd("hpwork",
|
||||
SCHED_DEFAULT,
|
||||
SCHED_PRIORITY_MAX - 1,
|
||||
2000,
|
||||
@ -203,7 +203,7 @@ void work_queues_init(void)
|
||||
(char *const *)NULL);
|
||||
|
||||
// Create low priority worker thread
|
||||
g_work[LPWORK].pid = px4_task_spawn_cmd("wkr_low",
|
||||
g_work[LPWORK].pid = px4_task_spawn_cmd("lpwork",
|
||||
SCHED_DEFAULT,
|
||||
SCHED_PRIORITY_MIN,
|
||||
2000,
|
||||
@ -306,6 +306,14 @@ int work_usrthread(int argc, char *argv[])
|
||||
{
|
||||
/* Loop forever */
|
||||
|
||||
int rv;
|
||||
// set the threads name
|
||||
#ifdef __PX4_DARWIN
|
||||
rv = pthread_setname_np("USR");
|
||||
#else
|
||||
rv = pthread_setname_np(pthread_self(), "USR");
|
||||
#endif
|
||||
|
||||
for (;;) {
|
||||
/* Then process queued work. We need to keep interrupts disabled while
|
||||
* we process items in the work list.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user