4 <strong>Function
</strong> - Attempt to acquire access rights to a lock.
7 <strong>kern_return_t lock_try
</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 lock.
18 <dt> <var>lock_id
</var>
20 [in scalar] The lock, represented by the lock set, to be acquired.
24 The
<strong>lock_try
</strong> function attempts to acquire the specified lock without
25 blocking. The return value indicates whether the lock was acquired.
26 <h3>RETURN VALUES
</h3>
29 <dt> <strong>KERN_INVALID_ARGUMENT
</strong>
31 The specified lock_set is invalid, or the lock_id is out of range.
33 <dt> <strong>KERN_SUCCESS
</strong>
35 The lock was acquired.
37 <dt> <strong>KERN_LOCK_UNSTABLE
</strong>
39 The acquired lock has an unstable state.
41 <dt> <strong>KERN_LOCK_SET_DESTROYED
</strong>
43 The specified lock has been destroyed.
45 <dt> <strong>KERN_LOCK_OWNED
</strong>
47 Another thread currently owns the requested lock.
49 <dt> <strong>KERN_LOCK_OWNED_SELF
</strong>
51 The calling thread already owns the lock.
53 <h3>RELATED INFORMATION
</h3>
56 <a href=
"lock_acquire.html"><strong>lock_acquire
</strong></a>,
57 <a href=
"lock_make_stable.html"><strong>lock_make_stable
</strong></a>,
58 <a href=
"lock_release.html"><strong>lock_release
</strong></a>,
59 <a href=
"lock_handoff.html"><strong>lock_handoff
</strong></a>,
60 <a href=
"lock_handoff_accept.html"><strong>lock_handoff_accept
</strong></a>,
61 <a href=
"lock_set_create.html"><strong>lock_set_create
</strong></a>,
62 <a href=
"lock_set_destroy.html"><strong>lock_set_destroy
</strong></a>.