Skip to content

Commit

Permalink
[wq][fix]工作队列默认使用C99标准实现遍历
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbb666 committed Jan 5, 2025
1 parent ebe05a9 commit 2682c32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/drivers/ipc/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void _workqueue_thread_entry(void *parameter)
struct rt_workqueue *queue;
rt_tick_t current_tick;
rt_int32_t delay_tick;
void (*work_func)(struct rt_work *work, void *work_data);
void (*work_func)(struct rt_work * work, void *work_data);
void *work_data;

queue = (struct rt_workqueue *)parameter;
Expand Down Expand Up @@ -142,7 +142,9 @@ static rt_err_t _workqueue_submit_work(struct rt_workqueue *queue,
work->timeout_tick = rt_tick_get() + ticks;

list_tmp = &(queue->delayed_list);
rt_list_for_each_entry(work_tmp, &(queue->delayed_list), list)
for (work_tmp = rt_list_entry(list_tmp->next, struct rt_work, list);
&work_tmp->list != list_tmp;
work_tmp = rt_list_entry(work_tmp->list.next, struct rt_work, list))
{
if ((work_tmp->timeout_tick - work->timeout_tick) < RT_TICK_MAX / 2)
{
Expand Down

0 comments on commit 2682c32

Please sign in to comment.