|
n != &(rt_soft_timer_list[RT_TIMER_SKIP_LIST_LEVEL - 1]);) |
|
{ |
|
t = rt_list_entry(n, struct rt_timer, row[RT_TIMER_SKIP_LIST_LEVEL - 1]); |
|
|
|
/* |
|
* It supposes that the new tick shall less than the half duration of |
|
* tick max. |
|
*/ |
|
if ((current_tick - t->timeout_tick) < RT_TICK_MAX / 2) |
|
{ |
|
RT_OBJECT_HOOK_CALL(rt_timer_enter_hook, (t)); |
|
|
|
/* move node to the next */ |
|
n = n->next; |
|
|
|
/* remove timer from timer list firstly */ |
|
_rt_timer_remove(t); |
|
|
|
/* not lock scheduler when performing timeout function */ |
|
rt_exit_critical(); |
由于这里的list遍历会出现严重的迭代失效问题,导致softtimer任务死循环。
正确的处理方式应该和系统timerlist一致。
rt-thread/src/timer.c
Lines 609 to 628 in d463a5a
由于这里的list遍历会出现严重的迭代失效问题,导致softtimer任务死循环。
正确的处理方式应该和系统timerlist一致。