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