Function - Hand-off ownership of a lock.
[in send right] The port naming the lock set which represents the
[in scalar] The lock, represented by the lock set, to be handed off.
The lock_handoff function passes lock ownership from the calling
thread to an anonymous accepting thread. The lock must be owned by the
calling thread. If the accepting thread is not waiting to receive the
lock, the calling thread will block until the hand-off is accepted.
The specified lock_set is invalid, or the lock_id is out of range.
The calling thread does not own the lock being handed off.
The lock hand-off was successful.
The specified lock has been destroyed.
While blocked to wait for the accepting thread to assume the lock's ownership,
the calling thread was awoken by an unrelated event;
the lock's handoff state is cleared.