[components][drivers][ipc] 完善工作队列,增强稳定性

1. 可直接提交延时任务, 无需额外调用延时初始化
2. 修复延时任务 PENDING 时,取消任务会递归调用的问题
This commit is contained in:
tangyuxin
2019-08-05 14:18:15 +08:00
parent 87267b41bc
commit badd211457
2 changed files with 32 additions and 22 deletions

View File

@@ -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