fix rt_tick_increase critical code protection
This commit is contained in:
parent
59bec27364
commit
37960723b8
|
@ -76,10 +76,14 @@ void rt_tick_increase(void)
|
||||||
-- thread->remaining_tick;
|
-- thread->remaining_tick;
|
||||||
if (thread->remaining_tick == 0)
|
if (thread->remaining_tick == 0)
|
||||||
{
|
{
|
||||||
|
rt_base_t level;
|
||||||
|
|
||||||
/* change to initialized tick */
|
/* change to initialized tick */
|
||||||
thread->remaining_tick = thread->init_tick;
|
thread->remaining_tick = thread->init_tick;
|
||||||
|
|
||||||
|
level = rt_hw_interrupt_disable();
|
||||||
thread->stat |= RT_THREAD_STAT_YIELD;
|
thread->stat |= RT_THREAD_STAT_YIELD;
|
||||||
|
rt_hw_interrupt_enable(level);
|
||||||
|
|
||||||
rt_schedule();
|
rt_schedule();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue