mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-08 20:05:29 +08:00
[Kernel] Fix the critical issue when scheduler not start
This commit is contained in:
@@ -884,14 +884,17 @@ void rt_exit_critical(void)
|
||||
level = rt_hw_interrupt_disable();
|
||||
|
||||
rt_scheduler_lock_nest --;
|
||||
|
||||
if (rt_scheduler_lock_nest <= 0)
|
||||
{
|
||||
rt_scheduler_lock_nest = 0;
|
||||
/* enable interrupt */
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
rt_schedule();
|
||||
if (rt_current_thread)
|
||||
{
|
||||
/* if scheduler is started, do a schedule */
|
||||
rt_schedule();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user