lock_handoff_accept


Function - Accept a lock hand-off.

SYNOPSIS

kern_return_t   lock_handoff_accept
                (lock_set_t                            lock_set,
                 int                                    lock_id);

PARAMETERS

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.

DESCRIPTION

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.

RETURN VALUES

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.

RELATED INFORMATION

Functions: lock_acquire, lock_release, lock_try, lock_handoff.