diff options
| author | Bernard Xiong <[email protected]> | 2019-05-13 12:12:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-13 12:12:50 +0800 |
| commit | 9f7cc78b06e45b18d1385a4827e4c03364a13a8f (patch) | |
| tree | 03c717e823c4a825199b7293ddaba9d2730725b8 /include | |
| parent | 91f6abb7652e5e3e0fb715855e9314723c2e1e75 (diff) | |
| parent | ab595cc8640ba998f7f3172d573742c56f577e33 (diff) | |
Merge pull request #2680 from BernardXiong/pthreads
[pthreads] Change the pthreads management.
Diffstat (limited to 'include')
| -rw-r--r-- | include/rthw.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/rthw.h b/include/rthw.h index fc9cb3cd16..ef3dc087ad 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -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 |
