mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 10:36:04 +08:00
[pthreads] Add spinlock declare and fix code issue.
This commit is contained in:
@@ -157,6 +157,7 @@ extern rt_hw_spinlock_t _rt_critical_lock;
|
||||
(rt_hw_spinlock_t) __RT_HW_SPIN_LOCK_INITIALIZER(lockname)
|
||||
|
||||
#define RT_DEFINE_SPINLOCK(x) rt_hw_spinlock_t x = __RT_HW_SPIN_LOCK_UNLOCKED(x)
|
||||
#define RT_DECLARE_SPINLOCK(x)
|
||||
|
||||
/**
|
||||
* ipi function
|
||||
@@ -172,6 +173,13 @@ void rt_hw_secondary_cpu_up(void);
|
||||
* secondary cpu idle function
|
||||
*/
|
||||
void rt_hw_secondary_cpu_idle_exec(void);
|
||||
#else
|
||||
|
||||
#define RT_DEFINE_SPINLOCK(x)
|
||||
#define RT_DECLARE_SPINLOCK(x) rt_ubase_t x
|
||||
|
||||
#define rt_hw_spin_lock(lock) *(lock) = rt_hw_interrupt_disable()
|
||||
#define rt_hw_spin_unlock(lock) rt_hw_interrupt_enable(*(lock))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user