RTEMS Logo

RTEMS 4.9.2 On-Line Library


Semaphore Manager SEMAPHORE_DELETE - Delete a semaphore

PREV UP NEXT Bookshelf RTEMS C User's Guide

9.4.3: SEMAPHORE_DELETE - Delete a semaphore

CALLING SEQUENCE:

rtems_status_code rtems_semaphore_delete(
  rtems_id id
);

DIRECTIVE STATUS CODES:

RTEMS_SUCCESSFUL - semaphore deleted successfully
RTEMS_INVALID_ID - invalid semaphore id
RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot delete remote semaphore
RTEMS_RESOURCE_IN_USE - binary semaphore is in use

DESCRIPTION:

This directive deletes the semaphore specified by id. All tasks blocked waiting to acquire the semaphore will be readied and returned a status code which indicates that the semaphore was deleted. The SMCB for this semaphore is reclaimed by RTEMS.

NOTES:

The calling task will be preempted if it is enabled by the task's execution mode and a higher priority local task is waiting on the deleted semaphore. The calling task will NOT be preempted if all of the tasks that are waiting on the semaphore are remote tasks.

The calling task does not have to be the task that created the semaphore. Any local task that knows the semaphore id can delete the semaphore.

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

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

Proxies, used to represent remote tasks, are reclaimed when the semaphore is deleted.


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2008 OAR Corporation