]>
Commit | Line | Data |
---|---|---|
13fec989 A |
1 | <h2>lock_set_create</h2> |
2 | <hr> | |
3 | <p> | |
4 | <strong>Function</strong> - Create a new lock set. | |
5 | <h3>SYNOPSIS</h3> | |
6 | <pre> | |
7 | <strong>kern_return_t lock_set_create</strong> | |
8 | <strong>(task_t</strong> <var>task</var>, | |
9 | <strong>lock_set_t</strong> <var>lock_set</var>, | |
10 | <strong>int</strong> <var>locks</var>, | |
11 | <strong>int</strong> <var>policy</var><strong>);</strong> | |
12 | </pre> | |
13 | <h3>PARAMETERS</h3> | |
14 | <dl> | |
15 | <p> | |
16 | <dt> <var>task</var> | |
17 | <dd> | |
18 | The task receiving the send right to the newly created lock set. | |
19 | <p> | |
20 | <dt> <var>lock_set</var> | |
21 | <dd> | |
22 | [out send right] The port naming the lock set which represents the lock. | |
23 | <p> | |
24 | <dt> <var>locks</var> | |
25 | <dd> | |
26 | [in scalar] The number of locks the lock set will represent (must be a positive value). | |
27 | <p> | |
28 | <dt> <var>policy</var> | |
29 | <dd> | |
30 | [in scalar] The blocked thread wakeup policy for the newly created lock set. Valid policies are: | |
31 | <dl> | |
32 | <p> | |
33 | <dt> SYNC_POLICY_FIFO | |
34 | <dd> | |
35 | a first-in-first-out policy for scheduling thread wakeup. | |
36 | <p> | |
37 | <dt> SYNC_POLICY_FIXED_PRIORITY | |
38 | <dd> | |
39 | a fixed priority policy for scheduling thread wakeup. | |
40 | </dl> | |
41 | </dl> | |
42 | <h3>DESCRIPTION</h3> | |
43 | <p> | |
44 | The <strong>lock_set_create</strong> function creates a new lock set representing a | |
45 | collection of associated locks. The lock set is associated with the | |
46 | specified task. A send right naming the lock set is returned to the | |
47 | caller. | |
48 | <h3>RETURN VALUES</h3> | |
49 | <dl> | |
50 | <p> | |
51 | <dt> <strong>KERN_SUCCESS</strong> | |
52 | <dd> | |
53 | The lock set was created. | |
54 | <p> | |
55 | <dt> <strong>KERN_INVALID_ARGUMENT</strong> | |
56 | <dd> | |
57 | Either the task or policy argument is invalid, or the locks argument | |
58 | has a value that is less than or equal to zero. | |
59 | <p> | |
60 | <dt> <strong>KERN_RESOURCE_SHORTAGE</strong> | |
61 | <dd> | |
62 | The kernel could not allocate the lock set. | |
63 | </dl> | |
64 | <h3>RELATED INFORMATION</h3> | |
65 | <p> | |
66 | Functions: | |
67 | <a href="lock_acquire.html"><strong>lock_acquire</strong></a>, | |
68 | <a href="lock_make_stable.html"><strong>lock_make_stable</strong></a>, | |
69 | <a href="lock_try.html"><strong>lock_try</strong></a>, | |
70 | <a href="lock_handoff.html"><strong>lock_handoff</strong></a>, | |
71 | <a href="lock_handoff_accept.html"><strong>lock_handoff_accept</strong></a>, | |
72 | <a href="lock_try.html"><strong>lock_try</strong></a>, | |
73 | <a href="lock_set_destroy.html"><strong>lock_set_destroy</strong></a>. |