pub unsafe extern "C" fn k_work_queue_stop(
queue: *mut k_work_q,
timeout: k_timeout_t,
) -> i32Expand description
@brief Stop a work queue.
Stops the work queue thread and ensures that no further work will be processed. This call is blocking and guarantees that the work queue thread has terminated cleanly if successful, no work will be processed past this point.
The queue must have been drained and plugged first (for example via k_work_queue_drain() with the @p plug option enabled); otherwise the call returns -EBUSY.
@param queue Pointer to the queue structure. @param timeout Maximum time to wait for the work queue to stop.
@retval 0 if the work queue was stopped @retval -EALREADY if the work queue was not started (or already stopped) @retval -EBUSY if the work queue has not been plugged @retval -ETIMEDOUT if the work queue did not stop within the stipulated timeout @retval -ENOTSUP if the work queue is essential