From 8bf5a285281d5699630fa1d2c9f12db1d0d2263c Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 16 Jan 2022 16:00:55 -0500 Subject: [workqueue] 增加rt_work_urgent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/src/workqueue.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'components/drivers/src') diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c index fe42ede0f6..58cb0ddf56 100644 --- a/components/drivers/src/workqueue.c +++ b/components/drivers/src/workqueue.c @@ -7,7 +7,8 @@ * Date Author Notes * 2017-02-27 Bernard fix the re-work issue. * 2021-08-01 Meco Man remove rt_delayed_work_init() - * 2021-08-14 Jackistang add comments for function interface. + * 2021-08-14 Jackistang add comments for function interface + * 2022-01-16 Meco Man add rt_work_urgent() */ #include @@ -468,6 +469,18 @@ rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t ticks) return rt_workqueue_submit_work(sys_workq, work, ticks); } +/** + * @brief Submit a work item to the system work queue without delay. This work item will be executed after the current work item. + * + * @param work is a pointer to the work item object. + * + * @return RT_EOK Success. + */ +rt_err_t rt_work_urgent(struct rt_work *work) +{ + return rt_workqueue_urgent_work(sys_workq, work); +} + /** * @brief Cancel a work item in the system work queue. * @@ -486,7 +499,7 @@ static int rt_work_sys_workqueue_init(void) if (sys_workq != RT_NULL) return RT_EOK; - sys_workq = rt_workqueue_create("sys_work", RT_SYSTEM_WORKQUEUE_STACKSIZE, + sys_workq = rt_workqueue_create("sys workq", RT_SYSTEM_WORKQUEUE_STACKSIZE, RT_SYSTEM_WORKQUEUE_PRIORITY); RT_ASSERT(sys_workq != RT_NULL); -- cgit v1.3.1