File indexing completed on 2025-01-30 09:33:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_ATOMIC_DETAIL_FENCE_OPS_WINDOWS_HPP_INCLUDED_
0015 #define BOOST_ATOMIC_DETAIL_FENCE_OPS_WINDOWS_HPP_INCLUDED_
0016
0017 #include <boost/cstdint.hpp>
0018 #include <boost/memory_order.hpp>
0019 #include <boost/atomic/detail/config.hpp>
0020 #include <boost/atomic/detail/interlocked.hpp>
0021 #include <boost/atomic/detail/ops_msvc_common.hpp>
0022 #include <boost/atomic/detail/header.hpp>
0023
0024 #ifdef BOOST_HAS_PRAGMA_ONCE
0025 #pragma once
0026 #endif
0027
0028 namespace boost {
0029 namespace atomics {
0030 namespace detail {
0031
0032
0033 struct fence_operations_windows
0034 {
0035 static BOOST_FORCEINLINE void thread_fence(memory_order order) BOOST_NOEXCEPT
0036 {
0037 if (order != memory_order_relaxed)
0038 {
0039 BOOST_ATOMIC_DETAIL_COMPILER_BARRIER();
0040 if (order == memory_order_seq_cst)
0041 hardware_full_fence();
0042 BOOST_ATOMIC_DETAIL_COMPILER_BARRIER();
0043 }
0044 }
0045
0046 static BOOST_FORCEINLINE void signal_fence(memory_order order) BOOST_NOEXCEPT
0047 {
0048 if (order != memory_order_relaxed)
0049 BOOST_ATOMIC_DETAIL_COMPILER_BARRIER();
0050 }
0051
0052 static BOOST_FORCEINLINE void hardware_full_fence() BOOST_NOEXCEPT
0053 {
0054 boost::uint32_t tmp;
0055 BOOST_ATOMIC_INTERLOCKED_INCREMENT(&tmp);
0056 }
0057 };
0058
0059 typedef fence_operations_windows fence_operations;
0060
0061 }
0062 }
0063 }
0064
0065 #include <boost/atomic/detail/footer.hpp>
0066
0067 #endif