procedure Task_Restart ( ID : in RTEMS.ID; Argument : in RTEMS.Task_Argument; Result : out RTEMS.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
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. 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.
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.
Copyright © 1988-2007OAR Corporation