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