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

Function _workqueue_cancel_work

components/drivers/ipc/workqueue.c:168–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168static rt_err_t _workqueue_cancel_work(struct rt_workqueue *queue, struct rt_work *work)
169{
170 rt_base_t level;
171 rt_err_t err;
172
173 level = rt_spin_lock_irqsave(&(queue->spinlock));
174 rt_list_remove(&(work->list));
175 work->flags = 0;
176 err = queue->work_current != work ? RT_EOK : -RT_EBUSY;
177 work->workqueue = RT_NULL;
178 rt_spin_unlock_irqrestore(&(queue->spinlock), level);
179 return err;
180}
181
182/**
183 * @brief Initialize a work item, binding with a callback function.

Callers 3

rt_workqueue_cancel_workFunction · 0.85

Calls 3

rt_list_removeFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.50

Tested by

no test coverage detected