mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-03-03 19:45:29 +08:00
[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:
parent
4ea463d83f
commit
2aacba2c86
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user