osfmk/man/lock_handoff_accept.html
Function - Accept a lock hand-off.
**kern\_return\_t lock\_handoff\_accept**** (lock\_set\_t **lock\_set,** int **lock\_id** );**
lock_set[in send right] The port naming the lock set which represents the lock.
lock_id[in scalar] The lock, represented by the lock set, that is the object of the handoff operation.
The lock_handoff_accept function accepts a lock hand-off from an anonymous sending thread. If the sending thread is not waiting to hand-off the lock, the calling thread will block until the lock handoff is completed. Only one thread may be waiting to accept a lock handoff at any given time.
KERN_ALREADY_WAITING Another thread is already waiting for a hand-off of this lock.
KERN_INVALID_ARGUMENT The specified lock_set is invalid, or the lock_id is out of range.
KERN_SUCCESS The lock hand-off was successful.
KERN_LOCK_UNSTABLE The acquired lock has an unstable state.
KERN_LOCK_SET_DESTROYED The specified lock has been destroyed.
KERN_ABORTED While blocked to wait for the sending thread to transfer the lock's ownership, the calling thread was awoken by an unrelated event; the lock's handoff state is cleared.
Functions: lock_acquire, lock_release, lock_try, lock_handoff.