MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_workqueue_urgent_work

Function rt_workqueue_urgent_work

components/drivers/ipc/workqueue.c:315–331  ·  view source on GitHub ↗

* @brief Submit a work item to the work queue without delay. This work item will be executed after the current work item. * * @param queue is a pointer to the workqueue object. * * @param work is a pointer to the work item object. * * @return RT_EOK Success. */

Source from the content-addressed store, hash-verified

313 * @return RT_EOK Success.
314 */
315rt_err_t rt_workqueue_urgent_work(struct rt_workqueue *queue, struct rt_work *work)
316{
317 rt_base_t level;
318
319 RT_ASSERT(queue != RT_NULL);
320 RT_ASSERT(work != RT_NULL);
321
322 level = rt_spin_lock_irqsave(&(queue->spinlock));
323 /* NOTE: the work MUST be initialized firstly */
324 rt_list_remove(&(work->list));
325 rt_list_insert_after(&queue->work_list, &(work->list));
326
327 rt_completion_done(&(queue->wakeup_completion));
328 rt_spin_unlock_irqrestore(&(queue->spinlock), level);
329
330 return RT_EOK;
331}
332
333/**
334 * @brief Cancel a work item in the work queue.

Callers 1

rt_work_urgentFunction · 0.85

Calls 5

rt_list_removeFunction · 0.85
rt_list_insert_afterFunction · 0.85
rt_completion_doneFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.50

Tested by

no test coverage detected