]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/semaphore_destroy.html
xnu-792.24.17.tar.gz
[apple/xnu.git] / osfmk / man / semaphore_destroy.html
CommitLineData
13fec989
A
1<h2>semaphore_destroy</h2>
2<hr>
3<p>
4<strong>Function</strong> - Destroy a semaphore.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>kern_return_t semaphore_destroy</strong>
8 <strong>(task_t</strong> <var>task</var>,
9 <strong>semaphore_t</strong> <var>semaphore</var><strong>);</strong>
10</pre>
11<h3>PARAMETERS</h3>
12<dl>
13<p>
14<dt> <var>task</var>
15<dd>
16[in task port] The task associated with the target semaphore.
17<p>
18<dt> <var>semaphore</var>
19<dd>
20[in send right] The port naming the semaphore to be destroyed.
21</dl>
22<h3>DESCRIPTION</h3>
23<p>
24The <strong>semaphore_destroy</strong> function destroys a semaphore.
25All send rights
26naming the semaphore become dead names. Threads waiting on the
27semaphore become unblocked with the return from the
28<strong>semaphore_wait</strong>
29call indicating that the semaphore was destroyed. A call to
30<strong>semaphore_destroy</strong> succeeds only if the semaphore is associated
31with the specified task.
32<h3>RETURN VALUES</h3>
33<dl>
34<p>
35<dt> <strong>KERN_INVALID_ARGUMENT</strong>
36<dd>
37Either, or both, the task or semaphore arguments were invalid.
38<p>
39<dt> <strong>KERN_INVALID_RIGHT</strong>
40<dd>
41The specified task does not own the specified semaphore.
42<p>
43<dt> <strong>KERN_TERMINATED</strong>
44<dd>
45The specified semaphore was previously destroyed.
46<p>
47<dt> <strong>KERN_SUCCESS</strong>
48<dd>
49The semaphore was destroyed.
50</dl>
51<h3>RELATED INFORMATION</h3>
52<p>
53Functions:
54<a href="semaphore_create.html"><strong>semaphore_create</strong></a>,
55<a href="semaphore_signal.html"><strong>semaphore_signal</strong></a>,
56<a href="semaphore_signal_all.html"><strong>semaphore_signal_all</strong></a>,
57<a href="semaphore_wait.html"><strong>semaphore_wait</strong></a>,
58<a href="device_get_status.html"><strong>device_get_status</strong></a>.