失败波形:
分析:
1.Debug:发现程序在启动成功3个线程后,进行调度到flag2线程时,未进入到flag线程;随后进入源码,单步运行分析;
void rt_schedule(void)
{
rt_base_t level;
register rt_ubase_t highest_ready_priority;
struct rt_thread *to_thread;
struct rt_thread *from_thread;
/* 关中断 */
level = rt_hw_interrupt_disable();
/* 获取最高就绪优先级 */
highest_ready_priority = __rt_ffs(rt_thread_ready_priority_group) - 1;
/* 获取将要运行线程的线程控制块 */
to_thread =