RTEMS Logo

RTEMS 4.10.2 On-Line Library


Task Manager TASK_DELETE - Delete a task

PREV UP NEXT Bookshelf RTEMS C User's Guide

5.4.6: TASK_DELETE - Delete a task

CALLING SEQUENCE:

rtems_status_code rtems_task_delete(
  rtems_id id
);

DIRECTIVE STATUS CODES:

RTEMS_SUCCESSFUL - task restarted successfully
RTEMS_INVALID_ID - task id invalid
RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task

DESCRIPTION:

This directive deletes a task, either the calling task or another task, as specified by id. RTEMS stops the execution of the task and reclaims the stack memory, any allocated delay or timeout timers, the TCB, and, if the task is RTEMS_FLOATING_POINT, its floating point context area. RTEMS does not reclaim the following resources: region segments, partition buffers, semaphores, timers, or rate monotonic periods.

NOTES:

A task is responsible for releasing its resources back to RTEMS before deletion. To insure proper deallocation of resources, a task should not be deleted unless it is unable to execute or does not hold any RTEMS resources. If a task holds RTEMS resources, the task should be allowed to deallocate its resources before deletion. A task can be directed to release its resources and delete itself by restarting it with a special argument or by sending it a message, an event, or a signal.

Deletion of the current task (RTEMS_SELF) will force RTEMS to select another task to execute.

When a global task is deleted, the task id must be transmitted to every node in the system for deletion from the local copy of the global object table.

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


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2008 OAR Corporation