zephyr::raw

Function k_sem_take

source
pub unsafe extern "C" fn k_sem_take(
    sem: *mut k_sem,
    timeout: k_timeout_t,
) -> i32
Expand description

@brief Take a semaphore.

This routine takes @a sem.

@note @a timeout must be set to K_NO_WAIT if called from ISR.

@funcprops \isr_ok

@param sem Address of the semaphore. @param timeout Waiting period to take the semaphore, or one of the special values K_NO_WAIT and K_FOREVER.

@retval 0 Semaphore taken. @retval -EBUSY Returned without waiting. @retval -EAGAIN Waiting period timed out, or the semaphore was reset during the waiting period.