osfmk/man/lock_set_create.html
Function - Create a new lock set.
**kern\_return\_t lock\_set\_create**** (task\_t **task,** lock\_set\_t **lock\_set,** int **locks,** int **policy** );**
taskThe task receiving the send right to the newly created lock set.
lock_set[out send right] The port naming the lock set which represents the lock.
locks[in scalar] The number of locks the lock set will represent (must be a positive value).
policy[in scalar] The blocked thread wakeup policy for the newly created lock set. Valid policies are:
SYNC_POLICY_FIFOa first-in-first-out policy for scheduling thread wakeup.
SYNC_POLICY_FIXED_PRIORITYa fixed priority policy for scheduling thread wakeup.
The lock_set_create function creates a new lock set representing a collection of associated locks. The lock set is associated with the specified task. A send right naming the lock set is returned to the caller.
KERN_SUCCESS The lock set was created.
KERN_INVALID_ARGUMENT Either the task or policy argument is invalid, or the locks argument has a value that is less than or equal to zero.
KERN_RESOURCE_SHORTAGE The kernel could not allocate the lock set.
Functions: lock_acquire, lock_make_stable, lock_try, lock_handoff, lock_handoff_accept, lock_try, lock_set_destroy.