Skip to content

Commit 380acd0

Browse files
author
Sam Price
committed
Fix #1482, rtems Timebase, and Console now have proper names.
1 parent a201177 commit 380acd0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/os/rtems/src/os-impl-console.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ static void OS_ConsoleTask_Entry(rtems_task_argument arg)
104104
OS_object_token_t token;
105105
OS_impl_console_internal_record_t *local;
106106

107+
pthread_setname_np(pthread_self(), "OS_CONSOLE");
108+
107109
if (OS_ObjectIdGetById(OS_LOCK_MODE_REFCOUNT, OS_OBJECT_TYPE_OS_CONSOLE, OS_ObjectIdFromInteger(arg), &token) ==
108110
OS_SUCCESS)
109111
{
@@ -172,8 +174,6 @@ int32 OS_ConsoleCreate_Impl(const OS_object_token_t *token)
172174
}
173175
else
174176
{
175-
pthread_setname_np(r_task_id, "OS_CONSOLE");
176-
177177
/* will place the task in 'ready for scheduling' state */
178178
status = rtems_task_start(r_task_id, /*rtems task id*/
179179
OS_ConsoleTask_Entry, /* task entry point */

src/os/rtems/src/os-impl-timebase.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ void OS_UsecsToTicks(uint32 usecs, rtems_interval *ticks)
286286
static void OS_TimeBase_CallbackThreadEntry(rtems_task_argument arg)
287287
{
288288
osal_id_t id;
289+
pthread_setname_np(pthread_self(), "OS_TIMEBASE");
289290
id = OS_ObjectIdFromInteger(arg);
290291
OS_TimeBase_CallbackThread(id);
291292
}
@@ -391,8 +392,6 @@ int32 OS_TimeBaseCreate_Impl(const OS_object_token_t *token)
391392
}
392393
else
393394
{
394-
pthread_setname_np(local->handler_task, "OS_TIMEBASE");
395-
396395
/* will place the task in 'ready for scheduling' state */
397396
rtems_sc = rtems_task_start(local->handler_task, /* rtems task id */
398397
OS_TimeBase_CallbackThreadEntry, /* task entry point */

0 commit comments

Comments
 (0)