zephyr::raw

Function k_stack_pop

source
pub unsafe extern "C" fn k_stack_pop(
    stack: *mut k_stack,
    data: *mut usize,
    timeout: k_timeout_t,
) -> i32
Expand description

@brief Pop an element from a stack.

This routine removes a stack_data_t value from @a stack in a “last in, first out” manner and stores the value in @a data.

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

@funcprops \isr_ok

@param stack Address of the stack. @param data Address of area to hold the value popped from the stack. @param timeout Waiting period to obtain a value, or one of the special values K_NO_WAIT and K_FOREVER.

@retval 0 Element popped from stack. @retval -EBUSY Returned without waiting. @retval -EAGAIN Waiting period timed out.