* @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. */
| 313 | * @return RT_EOK Success. |
| 314 | */ |
| 315 | rt_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. |
no test coverage detected