zephyr::raw

Function k_work_flush

source
pub unsafe extern "C" fn k_work_flush(
    work: *mut k_work,
    sync: *mut k_work_sync,
) -> bool
Expand description

@brief Wait for last-submitted instance to complete.

Resubmissions may occur while waiting, including chained submissions (from within the handler).

@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 work from a work queue running @p work.

@param work pointer to the 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 call had to wait for completion @retval false if work was already idle