]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/man/lock_set_create.html
xnu-7195.60.75.tar.gz
[apple/xnu.git] / osfmk / man / lock_set_create.html
... / ...
CommitLineData
1<h2>lock_set_create</h2>
2<hr>
3<p>
4<strong>Function</strong> - Create a new lock set.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>kern_return_t lock_set_create</strong>
8 <strong>(task_t</strong> <var>task</var>,
9 <strong>lock_set_t</strong> <var>lock_set</var>,
10 <strong>int</strong> <var>locks</var>,
11 <strong>int</strong> <var>policy</var><strong>);</strong>
12</pre>
13<h3>PARAMETERS</h3>
14<dl>
15<p>
16<dt> <var>task</var>
17<dd>
18The task receiving the send right to the newly created lock set.
19<p>
20<dt> <var>lock_set</var>
21<dd>
22[out send right] The port naming the lock set which represents the lock.
23<p>
24<dt> <var>locks</var>
25<dd>
26[in scalar] The number of locks the lock set will represent (must be a positive value).
27<p>
28<dt> <var>policy</var>
29<dd>
30[in scalar] The blocked thread wakeup policy for the newly created lock set. Valid policies are:
31 <dl>
32<p>
33<dt> SYNC_POLICY_FIFO
34<dd>
35a first-in-first-out policy for scheduling thread wakeup.
36<p>
37<dt> SYNC_POLICY_FIXED_PRIORITY
38<dd>
39a fixed priority policy for scheduling thread wakeup.
40</dl>
41</dl>
42<h3>DESCRIPTION</h3>
43<p>
44The <strong>lock_set_create</strong> function creates a new lock set representing a
45collection of associated locks. The lock set is associated with the
46specified task. A send right naming the lock set is returned to the
47caller.
48<h3>RETURN VALUES</h3>
49<dl>
50<p>
51<dt> <strong>KERN_SUCCESS</strong>
52<dd>
53The lock set was created.
54<p>
55<dt> <strong>KERN_INVALID_ARGUMENT</strong>
56<dd>
57Either the task or policy argument is invalid, or the locks argument
58has a value that is less than or equal to zero.
59<p>
60<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>
61<dd>
62The kernel could not allocate the lock set.
63</dl>
64<h3>RELATED INFORMATION</h3>
65<p>
66Functions:
67<a href="lock_acquire.html"><strong>lock_acquire</strong></a>,
68<a href="lock_make_stable.html"><strong>lock_make_stable</strong></a>,
69<a href="lock_try.html"><strong>lock_try</strong></a>,
70<a href="lock_handoff.html"><strong>lock_handoff</strong></a>,
71<a href="lock_handoff_accept.html"><strong>lock_handoff_accept</strong></a>,
72<a href="lock_try.html"><strong>lock_try</strong></a>,
73<a href="lock_set_destroy.html"><strong>lock_set_destroy</strong></a>.