zephyr::raw

Function k_condvar_wait

source
pub unsafe extern "C" fn k_condvar_wait(
    condvar: *mut k_condvar,
    mutex: *mut k_mutex,
    timeout: k_timeout_t,
) -> i32
Expand description

@brief Waits on the condition variable releasing the mutex lock

Atomically releases the currently owned mutex, blocks the current thread waiting on the condition variable specified by @a condvar, and finally acquires the mutex again.

The waiting thread unblocks only after another thread calls k_condvar_signal, or k_condvar_broadcast with the same condition variable.

@param condvar pointer to a @p k_condvar structure @param mutex Address of the mutex. @param timeout Waiting period for the condition variable or one of the special values K_NO_WAIT and K_FOREVER. @retval 0 On success @retval -EAGAIN Waiting period timed out.