Skip to content

Commit

Permalink
🐞 fix(cpu): cpus_lock should lock scheduler (#8368)
Browse files Browse the repository at this point in the history
  • Loading branch information
xqyjlj authored Dec 30, 2023
1 parent e045d30 commit 84706ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ rt_base_t rt_cpus_lock(void)
struct rt_cpu* pcpu;

level = rt_hw_local_irq_disable();

rt_enter_critical();
pcpu = rt_cpu_self();
if (pcpu->current_thread != RT_NULL)
{
Expand Down Expand Up @@ -207,6 +207,7 @@ void rt_cpus_unlock(rt_base_t level)
}
}
rt_hw_local_irq_enable(level);
rt_exit_critical();
}
RTM_EXPORT(rt_cpus_unlock);

Expand Down

0 comments on commit 84706ba

Please sign in to comment.