Wrong usage of ATOMIC_INT_LOCK_FREE
According to https://en.cppreference.com/w/c/atomic/ATOMIC_LOCK_FREE_consts the ATOMIC_INT_LOCK_FREE
can have three different values:
Value Explanation
0 The atomic type is never lock-free
1 The atomic type is sometimes lock-free
2 The atomic type is always lock-free
Therefore using defined(ATOMIC_INT_LOCK_FREE)
doesn't lead to desired result as it is defined even if the int
isn't really lock free.