mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
[compiler-rt builtins] Assert that atomic.c can be compiled correctly.
The spinlock requires that lock-free operations are available; otherwise, the implementation just calls itself. As discussed in D120026. Differential Revision: https://reviews.llvm.org/D123080
This commit is contained in:
parent
ee8aa351e4
commit
dd20323f51
@ -92,6 +92,8 @@ __inline static void lock(Lock *l) { OSSpinLockLock(l); }
|
||||
static Lock locks[SPINLOCK_COUNT]; // initialized to OS_SPINLOCK_INIT which is 0
|
||||
|
||||
#else
|
||||
_Static_assert(__atomic_always_lock_free(sizeof(uintptr_t), 0),
|
||||
"Implementation assumes lock-free pointer-size cmpxchg");
|
||||
typedef _Atomic(uintptr_t) Lock;
|
||||
/// Unlock a lock. This is a release operation.
|
||||
__inline static void unlock(Lock *l) {
|
||||
|
Loading…
Reference in New Issue
Block a user