diff options
| author | tangyuxin <[email protected]> | 2019-08-05 14:18:15 +0800 |
|---|---|---|
| committer | tangyuxin <[email protected]> | 2019-08-05 14:18:15 +0800 |
| commit | badd2114575190d8ec4ab9ee0e71f6452d2bf666 (patch) | |
| tree | 061bb1e18b56a3b4cef7d01296e37e3c27da830d /components/drivers/include | |
| parent | 87267b41bca07c9a0d6e87a33b604d23de3acc0d (diff) | |
[components][drivers][ipc] 完善工作队列,增强稳定性
1. 可直接提交延时任务, 无需额外调用延时初始化
2. 修复延时任务 PENDING 时,取消任务会递归调用的问题
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/ipc/workqueue.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h index 354a30c04e..23e256c420 100644 --- a/components/drivers/include/ipc/workqueue.h +++ b/components/drivers/include/ipc/workqueue.h @@ -43,13 +43,13 @@ struct rt_work void *work_data; rt_uint16_t flags; rt_uint16_t type; + struct rt_timer timer; + struct rt_workqueue *workqueue; }; struct rt_delayed_work { struct rt_work work; - struct rt_timer timer; - struct rt_workqueue *workqueue; }; #ifdef RT_USING_HEAP @@ -74,6 +74,7 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo rt_list_init(&(work->list)); work->work_func = work_func; work->work_data = work_data; + work->workqueue = RT_NULL; work->flags = 0; work->type = 0; } @@ -81,6 +82,7 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo void rt_delayed_work_init(struct rt_delayed_work *work, void (*work_func)(struct rt_work *work, void *work_data), void *work_data); +int rt_work_sys_workqueue_init(void); #endif #endif |
