1 #ifndef BOOST_DETAIL_ATOMIC_INTERLOCKED_HPP 2 #define BOOST_DETAIL_ATOMIC_INTERLOCKED_HPP 10 #include <boost/detail/interlocked.hpp> 12 #define BOOST_ATOMIC_CHAR_LOCK_FREE 2 13 #define BOOST_ATOMIC_SHORT_LOCK_FREE 2 14 #define BOOST_ATOMIC_INT_LOCK_FREE 2 15 #define BOOST_ATOMIC_LONG_LOCK_FREE (sizeof(long) <= 4 ? 2 : 0) 16 #define BOOST_ATOMIC_LLONG_LOCK_FREE (sizeof(long long) <= 4 ? 2 : 0) 17 #define BOOST_ATOMIC_ADDRESS_LOCK_FREE (sizeof(void *) <= 4 ? 2 : 0) 18 #define BOOST_ATOMIC_BOOL_LOCK_FREE 2 28 BOOST_INTERLOCKED_EXCHANGE(&tmp, 0);
66 expected = (T)BOOST_INTERLOCKED_COMPARE_EXCHANGE((
long *)(ptr), (
long)desired, (long)expected);
67 bool success = (prev==expected);
74 platform_cmpxchg64_strong(T & expected, T desired,
volatile T * ptr)
77 expected = (T) _InterlockedCompareExchange64((
long long *)(ptr), (
long long)desired, (
long long)expected);
78 bool success = (prev==expected);
86 #define BOOST_ATOMIC_THREAD_FENCE 2 static void platform_fence_before_store(memory_order order)
static void platform_fence_after_load(memory_order order)
static void atomic_thread_fence(memory_order order)
static void platform_fence_after_store(memory_order order)
bool platform_cmpxchg32_strong(T &expected, T desired, volatile T *ptr)
static void platform_fence_after(memory_order order)
static void platform_fence_before(memory_order order)
static void x86_full_fence(void)