zephyr::raw

Function k_work_reschedule_for_queue

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

@brief Reschedule a work item to a queue after a delay.

Unlike k_work_schedule_for_queue() this function can change the deadline of a scheduled work item, and will schedule a work item that is in any state (e.g. is idle, submitted, or running). This function does not affect (“unsubmit”) a work item that has been submitted to a queue.

@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 this is equivalent to k_work_submit_to_queue() after canceling any previous scheduled submission.

@note If delay is @c K_NO_WAIT (“no delay”) the return values are as with k_work_submit_to_queue().

@retval 0 if delay is @c K_NO_WAIT and work was already on a queue @retval 1 if

  • delay is @c K_NO_WAIT and work was not submitted but has now been queued to @p queue; or
  • delay not @c K_NO_WAIT and work has been scheduled @retval 2 if 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.