1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1998. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter Condition Variable Manager |
---|
10 | |
---|
11 | @section Introduction |
---|
12 | |
---|
13 | The condition variable manager ... |
---|
14 | |
---|
15 | The directives provided by the condition variable manager are: |
---|
16 | |
---|
17 | @itemize @bullet |
---|
18 | @item @code{pthread_condattr_init} - |
---|
19 | @item @code{pthread_condattr_destroy} - |
---|
20 | @item @code{pthread_condattr_setpshared} - |
---|
21 | @item @code{pthread_condattr_getpshared} - |
---|
22 | @item @code{pthread_cond_init} - |
---|
23 | @item @code{pthread_cond_destroy} - |
---|
24 | @item @code{pthread_cond_signal} - |
---|
25 | @item @code{pthread_cond_broadcast} - |
---|
26 | @item @code{pthread_cond_wait} - |
---|
27 | @item @code{pthread_cond_timedwait} - |
---|
28 | @end itemize |
---|
29 | |
---|
30 | @section Background |
---|
31 | |
---|
32 | @section Operations |
---|
33 | |
---|
34 | @section Directives |
---|
35 | |
---|
36 | This section details the condition variable manager's directives. |
---|
37 | A subsection is dedicated to each of this manager's directives |
---|
38 | and describes the calling sequence, related constants, usage, |
---|
39 | and status codes. |
---|
40 | |
---|
41 | @page |
---|
42 | @subsection pthread_condattr_init |
---|
43 | |
---|
44 | @subheading CALLING SEQUENCE: |
---|
45 | |
---|
46 | @example |
---|
47 | #include <pthread.h> |
---|
48 | |
---|
49 | int pthread_condattr_init( |
---|
50 | pthread_condattr_t *attr |
---|
51 | ); |
---|
52 | @end example |
---|
53 | |
---|
54 | @subheading STATUS CODES: |
---|
55 | @table @b |
---|
56 | @item ENOMEM |
---|
57 | Insufficient memory is available to initialize the condition variable |
---|
58 | attributes object. |
---|
59 | |
---|
60 | @end table |
---|
61 | |
---|
62 | @subheading DESCRIPTION: |
---|
63 | |
---|
64 | @subheading NOTES: |
---|
65 | |
---|
66 | @page |
---|
67 | @subsection pthread_condattr_destroy |
---|
68 | |
---|
69 | @subheading CALLING SEQUENCE: |
---|
70 | |
---|
71 | @example |
---|
72 | #include <pthread.h> |
---|
73 | |
---|
74 | int pthread_condattr_destroy( |
---|
75 | pthread_condattr_t *attr |
---|
76 | ); |
---|
77 | @end example |
---|
78 | |
---|
79 | @subheading STATUS CODES: |
---|
80 | @table @b |
---|
81 | @item EINVAL |
---|
82 | The attribute object specified is invalid. |
---|
83 | |
---|
84 | @end table |
---|
85 | |
---|
86 | @subheading DESCRIPTION: |
---|
87 | |
---|
88 | @subheading NOTES: |
---|
89 | |
---|
90 | @page |
---|
91 | @subsection pthread_condattr_setpshared |
---|
92 | |
---|
93 | @subheading CALLING SEQUENCE: |
---|
94 | |
---|
95 | @example |
---|
96 | #include <pthread.h> |
---|
97 | |
---|
98 | int pthread_condattr_setpshared( |
---|
99 | pthread_condattr_t *attr, |
---|
100 | int pshared |
---|
101 | ); |
---|
102 | @end example |
---|
103 | |
---|
104 | @subheading STATUS CODES: |
---|
105 | |
---|
106 | @table @b |
---|
107 | @item EINVAL |
---|
108 | Invalid argument passed. |
---|
109 | |
---|
110 | @end table |
---|
111 | |
---|
112 | @subheading DESCRIPTION: |
---|
113 | |
---|
114 | @subheading NOTES: |
---|
115 | |
---|
116 | @page |
---|
117 | @subsection pthread_condattr_getpshared |
---|
118 | |
---|
119 | @subheading CALLING SEQUENCE: |
---|
120 | |
---|
121 | @example |
---|
122 | #include <pthread.h> |
---|
123 | |
---|
124 | int pthread_condattr_getpshared( |
---|
125 | const pthread_condattr_t *attr, |
---|
126 | int *pshared |
---|
127 | ); |
---|
128 | @end example |
---|
129 | |
---|
130 | @subheading STATUS CODES: |
---|
131 | |
---|
132 | @table @b |
---|
133 | @item EINVAL |
---|
134 | Invalid argument passed. |
---|
135 | |
---|
136 | @end table |
---|
137 | |
---|
138 | @subheading DESCRIPTION: |
---|
139 | |
---|
140 | @subheading NOTES: |
---|
141 | |
---|
142 | |
---|
143 | @page |
---|
144 | @subsection pthread_cond_init |
---|
145 | |
---|
146 | @subheading CALLING SEQUENCE: |
---|
147 | |
---|
148 | @example |
---|
149 | #include <pthread.h> |
---|
150 | |
---|
151 | int pthread_cond_init( |
---|
152 | pthread_cond_t *cond, |
---|
153 | const pthread_condattr_t *attr |
---|
154 | ); |
---|
155 | @end example |
---|
156 | |
---|
157 | @subheading STATUS CODES: |
---|
158 | @table @b |
---|
159 | @item EAGAIN |
---|
160 | The system lacked a resource other than memory necessary to create the |
---|
161 | initialize the condition variable object. |
---|
162 | |
---|
163 | @item ENOMEM |
---|
164 | Insufficient memory is available to initialize the condition variable object. |
---|
165 | |
---|
166 | @item EBUSY |
---|
167 | The specified condition variable has already been initialized. |
---|
168 | |
---|
169 | @item EINVAL |
---|
170 | The specified attribute value is invalid. |
---|
171 | |
---|
172 | @end table |
---|
173 | |
---|
174 | @subheading DESCRIPTION: |
---|
175 | |
---|
176 | @subheading NOTES: |
---|
177 | |
---|
178 | @page |
---|
179 | @subsection pthread_cond_destroy |
---|
180 | |
---|
181 | @subheading CALLING SEQUENCE: |
---|
182 | |
---|
183 | @example |
---|
184 | #include <pthread.h> |
---|
185 | |
---|
186 | int pthread_cond_destroy( |
---|
187 | pthread_cond_t *cond |
---|
188 | ); |
---|
189 | @end example |
---|
190 | |
---|
191 | @subheading STATUS CODES: |
---|
192 | @table @b |
---|
193 | @item EINVAL |
---|
194 | The specified condition variable is invalid. |
---|
195 | |
---|
196 | @item EBUSY |
---|
197 | The specified condition variable is currently in use. |
---|
198 | |
---|
199 | @end table |
---|
200 | |
---|
201 | @subheading DESCRIPTION: |
---|
202 | |
---|
203 | @subheading NOTES: |
---|
204 | |
---|
205 | @page |
---|
206 | @subsection pthread_cond_signal |
---|
207 | |
---|
208 | @subheading CALLING SEQUENCE: |
---|
209 | |
---|
210 | @example |
---|
211 | #include <pthread.h> |
---|
212 | |
---|
213 | int pthread_cond_signal( |
---|
214 | pthread_cond_t *cond |
---|
215 | ); |
---|
216 | @end example |
---|
217 | |
---|
218 | @subheading STATUS CODES: |
---|
219 | @table @b |
---|
220 | @item EINVAL |
---|
221 | The specified condition variable is not valid. |
---|
222 | |
---|
223 | @end table |
---|
224 | |
---|
225 | @subheading DESCRIPTION: |
---|
226 | |
---|
227 | @subheading NOTES: |
---|
228 | |
---|
229 | This routine should not be invoked from a handler from an asynchronous signal |
---|
230 | handler or an interrupt service routine. |
---|
231 | |
---|
232 | @page |
---|
233 | @subsection pthread_cond_broadcast |
---|
234 | |
---|
235 | @subheading CALLING SEQUENCE: |
---|
236 | |
---|
237 | @example |
---|
238 | #include <pthread.h> |
---|
239 | |
---|
240 | int pthread_cond_broadcast( |
---|
241 | pthread_cond_t *cond |
---|
242 | ); |
---|
243 | @end example |
---|
244 | |
---|
245 | @subheading STATUS CODES: |
---|
246 | @table @b |
---|
247 | @item EINVAL |
---|
248 | The specified condition variable is not valid. |
---|
249 | |
---|
250 | @end table |
---|
251 | |
---|
252 | @subheading DESCRIPTION: |
---|
253 | |
---|
254 | @subheading NOTES: |
---|
255 | |
---|
256 | This routine should not be invoked from a handler from an asynchronous signal |
---|
257 | handler or an interrupt service routine. |
---|
258 | |
---|
259 | @page |
---|
260 | @subsection pthread_cond_wait |
---|
261 | |
---|
262 | @subheading CALLING SEQUENCE: |
---|
263 | |
---|
264 | @example |
---|
265 | #include <pthread.h> |
---|
266 | |
---|
267 | int pthread_cond_wait( |
---|
268 | pthread_cond_t *cond, |
---|
269 | pthread_mutex_t *mutex |
---|
270 | ); |
---|
271 | @end example |
---|
272 | |
---|
273 | @subheading STATUS CODES: |
---|
274 | @table @b |
---|
275 | @item EINVAL |
---|
276 | The specified condition variable or mutex is not initialized OR different |
---|
277 | mutexes were specified for concurrent pthread_cond_wait() and |
---|
278 | pthread_cond_timedwait() operations on the same condition variable OR |
---|
279 | the mutex was not owned by the current thread at the time of the call. |
---|
280 | |
---|
281 | @end table |
---|
282 | |
---|
283 | @subheading DESCRIPTION: |
---|
284 | |
---|
285 | @subheading NOTES: |
---|
286 | |
---|
287 | @page |
---|
288 | @subsection pthread_cond_timedwait |
---|
289 | |
---|
290 | @subheading CALLING SEQUENCE: |
---|
291 | |
---|
292 | @example |
---|
293 | #include <pthread.h> |
---|
294 | |
---|
295 | int pthread_cond_timedwait( |
---|
296 | pthread_cond_t *cond, |
---|
297 | pthread_mutex_t *mutex, |
---|
298 | const struct timespec *abstime |
---|
299 | ); |
---|
300 | @end example |
---|
301 | |
---|
302 | @subheading STATUS CODES: |
---|
303 | @table @b |
---|
304 | @item EINVAL |
---|
305 | The specified condition variable or mutex is not initialized OR different |
---|
306 | mutexes were specified for concurrent pthread_cond_wait() and |
---|
307 | pthread_cond_timedwait() operations on the same condition variable OR |
---|
308 | the mutex was not owned by the current thread at the time of the call. |
---|
309 | |
---|
310 | @item ETIMEDOUT |
---|
311 | The specified time has elapsed without the condition variable being |
---|
312 | satisfied. |
---|
313 | |
---|
314 | @end table |
---|
315 | |
---|
316 | @subheading DESCRIPTION: |
---|
317 | |
---|
318 | @subheading NOTES: |
---|
319 | |
---|