RTEMS Logo

RTEMS 4.7.99.2 On-Line Library


Semaphore Manager SEMAPHORE_DELETE - Delete a semaphore

PREV UP NEXT Bookshelf RTEMS Ada User's Guide

9.4.3: SEMAPHORE_DELETE - Delete a semaphore

CALLING SEQUENCE:

procedure Semaphore_Delete (
   ID     : in     RTEMS.ID;
   Result :    out RTEMS.Status_Codes
);

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 Ada User's Guide

Copyright © 1988-2004 OAR Corporation