zephyr::raw

Function k_work_schedule_for_queue

source
pub unsafe extern "C" fn k_work_schedule_for_queue(
    queue: *mut k_work_q,
    dwork: *mut k_work_delayable,
    delay: k_timeout_t,
) -> i32
Expand description

@brief Submit an idle work item to a queue after a delay.

Unlike k_work_reschedule_for_queue() this is a no-op if the work item is already scheduled or submitted, even if @p delay is @c K_NO_WAIT.

@funcprops \isr_ok

@param queue the queue on which the work item should be submitted after the delay.

@param dwork pointer to the delayable work item.

@param delay the time to wait before submitting the work item. If @c K_NO_WAIT and the work is not pending this is equivalent to k_work_submit_to_queue().

@retval 0 if work was already scheduled or submitted. @retval 1 if work has been scheduled. @retval 2 if @p delay is @c K_NO_WAIT and work was running and has been queued to the queue that was running it. @retval -EBUSY if @p delay is @c K_NO_WAIT and k_work_submit_to_queue() fails with this code. @retval -EINVAL if @p delay is @c K_NO_WAIT and k_work_submit_to_queue() fails with this code. @retval -ENODEV if @p delay is @c K_NO_WAIT and k_work_submit_to_queue() fails with this code.