porting/npl/nuttx: add support for thread names

Use pthread_setname_np() to set names for created tasks

Signed-off-by: Petro Karashchenko <[email protected]>
This commit is contained in:
Petro Karashchenko
2023-07-08 22:08:07 +02:00
committed by Szymon Janc
parent a0f74cd181
commit 62cfff4840
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -91,6 +91,7 @@ ble_npl_callout_init(struct ble_npl_callout *c,
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE);
pthread_create(&callout_thread, &attr, callout_handler, NULL);
pthread_setname_np(callout_thread, "ble_npl_callout");
thread_started = true;
}
+4
View File
@@ -77,6 +77,10 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
{
err = OS_ENOMEM;
}
else
{
pthread_setname_np(t->handle, t->name);
}
return err;
}