osfmk/man/lock_set_destroy.html
Function - Destroy a lock set and its associated locks.
**kern\_return\_t lock\_set\_destroy**** (task\_t **task,** lock\_set\_t **lock\_set** );**
taskThe task associated with the lock set.
lock_set[in send right] The port naming the lock set being destroyed.
The lock_set_destroy function will destroy a lock set and all of its associated locks. Threads that are blocked on locks represented by the destroyed lock set are unblocked and will receive a KERN_LOCK_SET_DESTROYED error message indicating that the lock set was destroyed. The lock_set_destroy function will only succeed if the specified task is associated with the specified lock set.
KERN_INVALID_ARGUMENT The specified lock set or task is invalid.
KERN_INVALID_RIGHT The specified task does not own the specified lock set.
KERN_LOCK_SET_DESTROYED The specified lock set does not exist.
KERN_SUCCESS The lock set was destroyed.
Functions: lock_acquire, lock_make_stable, lock_try, lock_handoff, lock_handoff_accept, lock_try, lock_set_create.