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