393 rt_hw_interrupt_enable(level); 394 395 #ifdef RT_USING_TIMER_SOFT396 if (timer->parent.flag & RT_TIMER_FLAG_SOFT_TIMER)397 {398 /* check whether timer thread is ready */399 if (timer_thread.stat != RT_THREAD_READY)400 {401 /* resume timer thread to check soft timer */402 rt_thread_resume(&timer_thread);403 rt_schedule();404 }405 }406 #endif
如果当前是rt_thread_timer_entry在执行,当运行到394行被抢占并且被添加了一个新的soft timer,会不会出现bug?
timer thread本来就在运行,resume和schedule是什么效果?
--
You received this message because you are subscribed to a topic in the Google Groups "rt-thread用户组" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rt-thread-cnusers/-bREUCrAnuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rt-thread-cnus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
timer thread本来就在运行,resume和schedule是什么效果?
所以我觉得这里有问题,被抢占后加的timer不会被timer thread察觉。
--
所以我觉得这里有问题,被抢占后加的timer不会被timer thread察觉。
393行使能了中断
--
timer thread是因为调用了delay到这个函数的,这之后应该会suspend,suspend的时间是根据之前加的timer的timeout时间,而在这里中断使能后加的timer得等这个time out之后才会被check,你可以看一下timer thread跑到这里的callstack,我手边现在没电脑,应该没记错。
--
timer thread是因为调用了delay到这个函数的,这之后应该会suspend,suspend的时间是根据之前加的timer的timeout时间,而在这里中断使能后加的timer得等这个time out之后才会被check,你可以看一下timer thread跑到这里的callstack,我手边现在没电脑,应该没记错。