12 spinlock() : value(0) {}
14 spinlock(const spinlock &) = delete;
15 spinlock(spinlock &&) = delete;
16 spinlock &operator=(const spinlock &) = delete;
21 // XXX: implement SPINLOCK_BACKOFF
23 while (v || !__sync_bool_compare_and_swap(&value, 0, 1)) {
27 COMPILER_MEMORY_FENCE;
33 return __sync_bool_compare_and_swap(&value, 0, 1);
41 COMPILER_MEMORY_FENCE;
52 volatile uint32_t value;
55 #endif /* _SPINLOCK_H_ */