rtems_status_code rtems_semaphore_release( rtems_id id );
RTEMS_SUCCESSFUL
- semaphore released successfully
RTEMS_INVALID_ID
- invalid semaphore id
RTEMS_NOT_OWNER_OF_RESOURCE
- calling task does not own semaphore
This directive releases the semaphore specified by id. The semaphore count is incremented by one. If the count is zero or negative, then the first task on this semaphore's wait queue is removed and unblocked. The unblocked task may preempt the running task if the running task's preemption mode is enabled and the unblocked task has a higher priority than the running task.
The calling task may be preempted if it causes a higher priority task to be made ready for execution.
Releasing a global semaphore which does not reside on the local node will generate a request telling the remote node to release the semaphore.
If the task to be unblocked resides on a different node from the semaphore, then the semaphore allocation is forwarded to the appropriate node, the waiting task is unblocked, and the proxy used to represent the task is reclaimed.
The outermost release of a local, binary, priority inheritance or priority ceiling semaphore may result in the calling task having its priority lowered. This will occur if the calling task holds no other binary semaphores and it has inherited a higher priority.
Copyright © 1988-2007OAR Corporation