semaphore_signal.html   [plain text]

<strong>Function</strong> - Increments the semaphore count.
<strong>kern_return_t   semaphore_signal</strong>
                <strong>(semaphore_t</strong>                          <var>semaphore</var><strong>);</strong>
<dt> <var>semaphore</var>
[in send right] The port naming the semaphore to be signalled.
The <strong>semaphore_signal</strong> function increments the semaphore count. If the
count goes non-negative (i.e. greater than or equal to 0) and a thread
is blocked on the semaphore, then the waiting thread is scheduled to
execute. If multiple threads are blocked on the semaphore, the thread
scheduled to execute is selected according to the wakeup policy of the
semaphore (set when the semaphore was created via <strong>semaphore_create</strong>).
Device driver interrupt service routines may safely execute
<strong>semaphore_signal</strong> operations without causing a deadlock.
<dt> <strong>KERN_INVALID_ARGUMENT</strong>
The specified semaphore is invalid.
<dt> <strong>KERN_TERMINATED</strong>
The specified semaphore has been destroyed.
<dt> <strong>KERN_SUCCESS</strong>
The semaphore has been signalled.
<a href="semaphore_create.html"><strong>semaphore_create</strong></a>,
<a href="semaphore_destroy.html"><strong>semaphore_destroy</strong></a>,
<a href="semaphore_signal_all.html"><strong>semaphore_signal_all</strong></a>,
<a href="semaphore_wait.html"><strong>semaphore_wait</strong></a>,
<a href="device_get_status.html"><strong>device_get_status</strong></a>.