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