Skip to main content

switch_thread_cond_wait

Function switch_thread_cond_wait 

Source
pub unsafe extern "C" fn switch_thread_cond_wait(
    cond: *mut switch_thread_cond_t,
    mutex: *mut switch_mutex_t,
) -> switch_status_t
Expand description

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. @param cond the condition variable on which to block. @param mutex the mutex that must be locked upon entering this function, is released while the thread is asleep, and is again acquired before returning from this function.