[src] Fixup UP irq_spinlock

Use scheduler lock in up irq_spinlock to avoid scheduling during spinlock.

Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
Shell 2024-04-18 20:03:12 +08:00 committed by Meco Man
parent 4ea463d83f
commit 2aacba2c86
1 changed files with 2 additions and 0 deletions

View File

@ -632,11 +632,13 @@ rt_inline rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
rt_base_t level;
RT_UNUSED(lock);
level = rt_hw_interrupt_disable();
rt_enter_critical();
return level;
}
rt_inline void rt_spin_unlock_irqrestore(struct rt_spinlock *lock, rt_base_t level)
{
RT_UNUSED(lock);
rt_exit_critical();
rt_hw_interrupt_enable(level);
}