| 1 | <h2>lock_acquire</h2> |
| 2 | <hr> |
| 3 | <p> |
| 4 | <strong>Function</strong> - Acquire access rights to a lock. |
| 5 | <h3>SYNOPSIS</h3> |
| 6 | <pre> |
| 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> |
| 10 | </pre> |
| 11 | <h3>PARAMETERS</h3> |
| 12 | <dl> |
| 13 | <p> |
| 14 | <dt> <var>lock_set</var> |
| 15 | <dd> |
| 16 | [in send right] The port naming the lock set which represents the |
| 17 | lock. |
| 18 | <p> |
| 19 | <dt> <var>lock_id</var> |
| 20 | <dd> |
| 21 | [in scalar] The lock, represented by the lock set, to be acquired. |
| 22 | </dl> |
| 23 | <h3>DESCRIPTION</h3> |
| 24 | <p> |
| 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> |
| 29 | <dl> |
| 30 | <p> |
| 31 | <dt> <strong>KERN_SUCCESS</strong> |
| 32 | <dd> |
| 33 | The lock was acquired. |
| 34 | <p> |
| 35 | <dt> <strong>KERN_INVALID_ARGUMENT</strong> |
| 36 | <dd> |
| 37 | The specified lock set is invalid, or the lock id is out of range. |
| 38 | <p> |
| 39 | <dt> <strong>KERN_LOCK_UNSTABLE</strong> |
| 40 | <dd> |
| 41 | The acquired lock has an unstable state. |
| 42 | <p> |
| 43 | <dt> <strong>KERN_LOCK_SET_DESTROYED</strong> |
| 44 | <dd> |
| 45 | The specified lock has been destroyed. |
| 46 | <p> |
| 47 | <dt> <strong>KERN_ABORTED</strong> |
| 48 | <dd> |
| 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. |
| 51 | </dl> |
| 52 | <h3>RELATED INFORMATION</h3> |
| 53 | <p> |
| 54 | Functions: |
| 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>. |