mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-07-31 23:27:52 +00:00
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:
committed by
Szymon Janc
parent
a0f74cd181
commit
62cfff4840
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user