xref: /xnu-8020.121.3/osfmk/man/lock_handoff_accept.html (revision fdd8201d7b966f0c3ea610489d29bd841d358941)
1*fdd8201dSApple OSS Distributions<h2>lock_handoff_accept</h2>
2*fdd8201dSApple OSS Distributions<hr>
3*fdd8201dSApple OSS Distributions<p>
4*fdd8201dSApple OSS Distributions<strong>Function</strong> - Accept a lock hand-off.
5*fdd8201dSApple OSS Distributions<h3>SYNOPSIS</h3>
6*fdd8201dSApple OSS Distributions<pre>
7*fdd8201dSApple OSS Distributions<strong>kern_return_t   lock_handoff_accept</strong>
8*fdd8201dSApple OSS Distributions                <strong>(lock_set_t</strong>                            <var>lock_set</var>,
9*fdd8201dSApple OSS Distributions                 <strong>int</strong>                                    <var>lock_id</var><strong>);</strong>
10*fdd8201dSApple OSS Distributions</pre>
11*fdd8201dSApple OSS Distributions<h3>PARAMETERS</h3>
12*fdd8201dSApple OSS Distributions<dl>
13*fdd8201dSApple OSS Distributions<p>
14*fdd8201dSApple OSS Distributions<dt> <var>lock_set</var>
15*fdd8201dSApple OSS Distributions<dd>
16*fdd8201dSApple OSS Distributions[in send right] The port naming the lock set which represents the
17*fdd8201dSApple OSS Distributionslock.
18*fdd8201dSApple OSS Distributions<p>
19*fdd8201dSApple OSS Distributions<dt> <var>lock_id</var>
20*fdd8201dSApple OSS Distributions<dd>
21*fdd8201dSApple OSS Distributions[in scalar] The lock, represented by the lock set, that is the object
22*fdd8201dSApple OSS Distributionsof the handoff operation.
23*fdd8201dSApple OSS Distributions</dl>
24*fdd8201dSApple OSS Distributions<h3>DESCRIPTION</h3>
25*fdd8201dSApple OSS Distributions<p>
26*fdd8201dSApple OSS DistributionsThe <strong>lock_handoff_accept</strong> function accepts a lock
27*fdd8201dSApple OSS Distributionshand-off from an anonymous sending thread. If the sending thread is
28*fdd8201dSApple OSS Distributionsnot waiting to hand-off the lock, the calling thread will block until
29*fdd8201dSApple OSS Distributionsthe lock handoff is completed.  Only one thread may be waiting to
30*fdd8201dSApple OSS Distributionsaccept a lock handoff at any given time.
31*fdd8201dSApple OSS Distributions<h3>RETURN VALUES</h3>
32*fdd8201dSApple OSS Distributions<dl>
33*fdd8201dSApple OSS Distributions<p>
34*fdd8201dSApple OSS Distributions<dt> <strong>KERN_ALREADY_WAITING</strong>
35*fdd8201dSApple OSS Distributions<dd>
36*fdd8201dSApple OSS DistributionsAnother thread is already waiting for a hand-off of this lock.
37*fdd8201dSApple OSS Distributions<p>
38*fdd8201dSApple OSS Distributions<dt> <strong>KERN_INVALID_ARGUMENT</strong>
39*fdd8201dSApple OSS Distributions<dd>
40*fdd8201dSApple OSS DistributionsThe specified lock_set is invalid, or the lock_id is out of range.
41*fdd8201dSApple OSS Distributions<p>
42*fdd8201dSApple OSS Distributions<dt> <strong>KERN_SUCCESS</strong>
43*fdd8201dSApple OSS Distributions<dd>
44*fdd8201dSApple OSS DistributionsThe lock hand-off was successful.
45*fdd8201dSApple OSS Distributions<p>
46*fdd8201dSApple OSS Distributions<dt> <strong>KERN_LOCK_UNSTABLE</strong>
47*fdd8201dSApple OSS Distributions<dd>
48*fdd8201dSApple OSS DistributionsThe acquired lock has an unstable state.
49*fdd8201dSApple OSS Distributions<p>
50*fdd8201dSApple OSS Distributions<dt> <strong>KERN_LOCK_SET_DESTROYED</strong>
51*fdd8201dSApple OSS Distributions<dd>
52*fdd8201dSApple OSS DistributionsThe specified lock has been destroyed.
53*fdd8201dSApple OSS Distributions<p>
54*fdd8201dSApple OSS Distributions<dt> <strong>KERN_ABORTED</strong>
55*fdd8201dSApple OSS Distributions<dd>
56*fdd8201dSApple OSS DistributionsWhile blocked to wait for the sending thread to transfer the lock's ownership,
57*fdd8201dSApple OSS Distributions     the calling thread was awoken by an unrelated event;
58*fdd8201dSApple OSS Distributions     the lock's handoff state is cleared.
59*fdd8201dSApple OSS Distributions</dl>
60*fdd8201dSApple OSS Distributions<h3>RELATED INFORMATION</h3>
61*fdd8201dSApple OSS Distributions<p>
62*fdd8201dSApple OSS DistributionsFunctions:
63*fdd8201dSApple OSS Distributions<a href="lock_acquire.html"><strong>lock_acquire</strong></a>,
64*fdd8201dSApple OSS Distributions<a href="lock_release.html"><strong>lock_release</strong></a>,
65*fdd8201dSApple OSS Distributions<a href="lock_try.html"><strong>lock_try</strong></a>,
66*fdd8201dSApple OSS Distributions<a href="lock_handoff.html"><strong>lock_handoff</strong></a>.
67