lock_set_create


Function - Create a new lock set.

SYNOPSIS

kern_return_t   lock_set_create
                (task_t                                    task,
                 lock_set_t                            lock_set,
                 int                                      locks,
                 int                                     policy);

PARAMETERS

task
The 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_FIFO
a first-in-first-out policy for scheduling thread wakeup.

SYNC_POLICY_FIXED_PRIORITY
a fixed priority policy for scheduling thread wakeup.

DESCRIPTION

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.

RETURN VALUES

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.

RELATED INFORMATION

Functions: lock_acquire, lock_make_stable, lock_try, lock_handoff, lock_handoff_accept, lock_try, lock_set_destroy.