]> git.saurik.com Git - apple/xnu.git/blob - osfmk/man/semaphore_signal.html
xnu-344.tar.gz
[apple/xnu.git] / osfmk / man / semaphore_signal.html
1 <h2>semaphore_signal</h2> <hr> <p> <strong>Function</strong> - Increments the semaphore count. <h3>SYNOPSIS</h3> <pre> <strong>kern_return_t semaphore_signal</strong> <strong>(semaphore_t</strong> <var>semaphore</var><strong>);</strong> </pre> <h3>PARAMETERS</h3> <dl> <p> <dt> <var>semaphore</var> <dd> [in send right] The port naming the semaphore to be signalled. </dl> <h3>DESCRIPTION</h3> <p> 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. <h3>RETURN VALUES</h3> <dl> <p> <dt> <strong>KERN_INVALID_ARGUMENT</strong> <dd> The specified semaphore is invalid. <p> <dt> <strong>KERN_TERMINATED</strong> <dd> The specified semaphore has been destroyed. <p> <dt> <strong>KERN_SUCCESS</strong> <dd> The semaphore has been signalled. </dl> <h3>RELATED INFORMATION</h3> <p> Functions: <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>.