Typedefs | |
| typedef apr_thread_cond_t | switch_thread_cond_t |
Functions | |
| switch_status_t | switch_thread_cond_create (switch_thread_cond_t **cond, switch_memory_pool_t *pool) |
| switch_status_t | switch_thread_cond_wait (switch_thread_cond_t *cond, switch_mutex_t *mutex) |
| switch_status_t | switch_thread_cond_timedwait (switch_thread_cond_t *cond, switch_mutex_t *mutex, switch_interval_time_t timeout) |
| switch_status_t | switch_thread_cond_signal (switch_thread_cond_t *cond) |
| switch_status_t | switch_thread_cond_broadcast (switch_thread_cond_t *cond) |
| switch_status_t | switch_thread_cond_destroy (switch_thread_cond_t *cond) |
|
|
Opaque structure for thread condition variables |
|
|
Signals all threads blocking on the given condition variable. Each thread that was signaled is then scheduled to wake up and acquire the associated mutex. This will happen in a serialized manner.
00292 {
00293 return apr_thread_cond_broadcast(cond);
00294 }
|
|
||||||||||||
|
Create and initialize a condition variable that can be used to signal and schedule threads in a single process.
00272 {
00273 return apr_thread_cond_create(cond, pool);
00274 }
|
|
|
Destroy the condition variable and free the associated memory.
00297 {
00298 return apr_thread_cond_destroy(cond);
00299 }
|
|
|
Signals a single thread, if one exists, that is blocking on the given condition variable. That thread is then scheduled to wake up and acquire the associated mutex. Although it is not required, if predictable scheduling is desired, that mutex must be locked while calling this function.
00287 {
00288 return apr_thread_cond_signal(cond);
00289 }
|
|
||||||||||||||||
|
Put the active calling thread to sleep until signaled to wake up or the timeout is reached. Each condition variable must be associated with a mutex, and that mutex must be locked before calling this function, or the behavior will be undefined. As the calling thread is put to sleep, the given mutex will be simultaneously released; and as this thread wakes up the lock is again simultaneously acquired.
00282 {
00283 return apr_thread_cond_timedwait(cond, mutex, timeout);
00284 }
|
|
||||||||||||
|
Put the active calling thread to sleep until signaled to wake up. Each condition variable must be associated with a mutex, and that mutex must be locked before calling this function, or the behavior will be undefined. As the calling thread is put to sleep, the given mutex will be simultaneously released; and as this thread wakes up the lock is again simultaneously acquired.
00277 {
00278 return apr_thread_cond_wait(cond, mutex);
00279 }
|
1.3.9.1