RTEMS Logo

RTEMS 4.9.2 On-Line Library


Task Manager TASK_RESTART - Restart a task

PREV UP NEXT Bookshelf RTEMS Ada User's Guide

5.4.5: TASK_RESTART - Restart a task

CALLING SEQUENCE:

procedure Task_Restart (
   ID       : in     RTEMS.ID;
   Argument : in     RTEMS.Task_Argument;
   Result   :    out RTEMS.Status_Codes
);

DIRECTIVE STATUS CODES:

RTEMS.SUCCESSFUL - task restarted successfully
RTEMS.INVALID_ID - task id invalid
RTEMS.INCORRECT_STATE - task never started
RTEMS.ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task

DESCRIPTION:

This directive resets the task specified by id to begin execution at its original starting address. The task's priority and execution mode are set to the original creation values. If the task is currently blocked, RTEMS automatically makes the task ready. A task can be restarted from any state, except the dormant state.

The task's starting argument is contained in argument. This argument can be a single value or an index into an array of parameter blocks. The type of this numeric argument is an unsigned integer type with the property that any valid pointer to void can be converted to this type and then converted back to a pointer to void. The result will compare equal to the original pointer. This new argument may be used to distinguish between the initial rtems.task_start of the task and any ensuing calls to rtems.task_restart of the task. This can be beneficial in deleting a task. Instead of deleting a task using the rtems.task_delete directive, a task can delete another task by restarting that task, and allowing that task to release resources back to RTEMS and then delete itself.

NOTES:

If id is RTEMS.SELF, the calling task will be restarted and will not return from this directive.

The calling task will be preempted if its preemption mode is enabled and the task being restarted has a higher priority.

The task must reside on the local node, even if the task was created with the RTEMS.GLOBAL option.


PREV UP NEXT Bookshelf RTEMS Ada User's Guide

Copyright © 1988-2008 OAR Corporation