Skip to content

vxworks osapi.c utility task doesn't exit #120

@skliper

Description

@skliper

The vxworks osapi.c has an optional task that is started in OS_API_Init():

/*---------------------------------------------------------------------------
 * Name:    UtilityTask
 * Purpose: If turned on, this task will print out the messages from
 *          the OS_printf buffer at a low priority. This will mean
 *          that the functions calling OS_printf will not block due to
 *          writing data to the UART
----------------------------------------------------------------------------*/
#ifdef OS_UTILITY_TASK_ON
void UtilityTask()
...

However, this utility task implementation has a while(TRUE) loop with no exit logic. For a "load and forever run it" scenario this may work, but for any other scenario where an orderly shutdown is desired by the user this means the task is never killed. One can get kernel crashes if the vxworks module is unloaded while that thread is still writing to output. The forever loop thread also makes line coverage difficult.

We need a robust method to always end this thread and to ensure the parent thread doesn't return to OS control while this thread is still hanging out there.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions