diff options
| author | Shell <[email protected]> | 2024-04-18 20:03:12 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2024-04-19 21:30:12 -0400 |
| commit | 2aacba2c868176e50ccd522e882ca0b194a9ed14 (patch) | |
| tree | 6c370d182f250b994ec3b14b456f3500c9ec2a3d | |
| parent | 4ea463d83f8c3467b9920cc7cb072e200dc6ce5f (diff) | |
[src] Fixup UP irq_spinlock
Use scheduler lock in up irq_spinlock to avoid scheduling during spinlock.
Signed-off-by: Shell <[email protected]>
| -rw-r--r-- | include/rtthread.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/rtthread.h b/include/rtthread.h index 55f57a2118..2329824112 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -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); } |
