diff --git a/src/os/rtems/src/os-impl-console.c b/src/os/rtems/src/os-impl-console.c index 04b6bc49c..d158d38ae 100644 --- a/src/os/rtems/src/os-impl-console.c +++ b/src/os/rtems/src/os-impl-console.c @@ -104,6 +104,8 @@ static void OS_ConsoleTask_Entry(rtems_task_argument arg) OS_object_token_t token; OS_impl_console_internal_record_t *local; + pthread_setname_np(pthread_self(), "OS_CONSOLE"); + if (OS_ObjectIdGetById(OS_LOCK_MODE_REFCOUNT, OS_OBJECT_TYPE_OS_CONSOLE, OS_ObjectIdFromInteger(arg), &token) == OS_SUCCESS) { @@ -172,8 +174,6 @@ int32 OS_ConsoleCreate_Impl(const OS_object_token_t *token) } else { - pthread_setname_np(r_task_id, "OS_CONSOLE"); - /* will place the task in 'ready for scheduling' state */ status = rtems_task_start(r_task_id, /*rtems task id*/ OS_ConsoleTask_Entry, /* task entry point */ diff --git a/src/os/rtems/src/os-impl-timebase.c b/src/os/rtems/src/os-impl-timebase.c index 2754bb8bd..c20cb522b 100644 --- a/src/os/rtems/src/os-impl-timebase.c +++ b/src/os/rtems/src/os-impl-timebase.c @@ -286,6 +286,7 @@ void OS_UsecsToTicks(uint32 usecs, rtems_interval *ticks) static void OS_TimeBase_CallbackThreadEntry(rtems_task_argument arg) { osal_id_t id; + pthread_setname_np(pthread_self(), "OS_TIMEBASE"); id = OS_ObjectIdFromInteger(arg); OS_TimeBase_CallbackThread(id); } @@ -391,8 +392,6 @@ int32 OS_TimeBaseCreate_Impl(const OS_object_token_t *token) } else { - pthread_setname_np(local->handler_task, "OS_TIMEBASE"); - /* will place the task in 'ready for scheduling' state */ rtems_sc = rtems_task_start(local->handler_task, /* rtems task id */ OS_TimeBase_CallbackThreadEntry, /* task entry point */