zephyr::raw

Function k_work_cancel_delayable_sync

source
pub unsafe extern "C" fn k_work_cancel_delayable_sync(
    dwork: *mut k_work_delayable,
    sync: *mut k_work_sync,
) -> bool
Expand description

@brief Cancel delayable work and wait.

Like k_work_cancel_delayable() but waits until the work becomes idle.

@note Canceling delayable work does not prevent rescheduling it. It does prevent submitting it until the cancellation completes.

@note Be careful of caller and work queue thread relative priority. If this function sleeps it will not return until the work queue thread completes the tasks that allow this thread to resume.

@note Behavior is undefined if this function is invoked on @p dwork from a work queue running @p dwork.

@param dwork pointer to the delayable work item.

@param sync pointer to an opaque item containing state related to the pending cancellation. The object must persist until the call returns, and be accessible from both the caller thread and the work queue thread. The object must not be used for any other flush or cancel operation until this one completes. On architectures with CONFIG_KERNEL_COHERENCE the object must be allocated in coherent memory.

@retval true if work was not idle (call had to wait for cancellation of a running handler to complete, or scheduled or submitted operations were cancelled); @retval false otherwise