linux 用户态锁实现,Linux下用户态自旋锁的实现
#include #include #include #include #include #define SPIN_LOCK 1static uint32_t atomic_cmp_set(uint32_t *lock, uint32_t old, uint32_t set){uint8_t rslt = 0;asm volatile ("lock;" // lock if SMP"c...