4 <strong>Function
</strong> - Acquire access rights to a lock.
7 <strong>kern_return_t lock_acquire
</strong>
8 <strong>(lock_set_t
</strong> <var>lock_set
</var>,
9 <strong>int
</strong> <var>lock_id
</var><strong>);
</strong>
14 <dt> <var>lock_set
</var>
16 [in send right] The port naming the lock set which represents the
19 <dt> <var>lock_id
</var>
21 [in scalar] The lock, represented by the lock set, to be acquired.
25 The
<strong>lock_acquire
</strong> function acquires access rights to a specific lock
26 being represented by a given lock set. If the lock is already
27 controlled by another thread then the calling thread will block.
28 <h3>RETURN VALUES
</h3>
31 <dt> <strong>KERN_SUCCESS
</strong>
33 The lock was acquired.
35 <dt> <strong>KERN_INVALID_ARGUMENT
</strong>
37 The specified lock set is invalid, or the lock id is out of range.
39 <dt> <strong>KERN_LOCK_UNSTABLE
</strong>
41 The acquired lock has an unstable state.
43 <dt> <strong>KERN_LOCK_SET_DESTROYED
</strong>
45 The specified lock has been destroyed.
47 <dt> <strong>KERN_ABORTED
</strong>
49 While blocked to wait for the specified lock to become available, the calling
50 thread was awoken by an unrelated event, such as thread termination.
52 <h3>RELATED INFORMATION
</h3>
55 <a href=
"lock_release.html"><strong>lock_release
</strong></a>,
56 <a href=
"lock_try.html"><strong>lock_try
</strong></a>,
57 <a href=
"lock_handoff.html"><strong>lock_handoff
</strong></a>,
58 <a href=
"lock_handoff_accept.html"><strong>lock_handoff_accept
</strong></a>,
59 <a href=
"lock_make_stable.html"><strong>lock_make_stable
</strong></a>,
60 <a href=
"lock_set_create.html"><strong>lock_set_create
</strong></a>,
61 <a href=
"lock_set_destroy.html"><strong>lock_set_destroy
</strong></a>.