11 #ifndef ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP 12 #define ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(__GNUC__) \ 21 && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ 22 && !defined(__INTEL_COMPILER) && !defined(__ICL) \ 23 && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) 30 class gcc_sync_fenced_block
34 enum half_or_full_t { half, full };
37 explicit gcc_sync_fenced_block(half_or_full_t)
40 __sync_lock_test_and_set(&value_, 1);
44 ~gcc_sync_fenced_block()
46 __sync_lock_release(&value_);
58 #endif // defined(__GNUC__) 63 #endif // ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP