2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * Copyright (c) 2011 Helge Bahmann
7 * Copyright (c) 2013 Tim Blechmann
8 * Copyright (c) 2014 Andrey Semashev
11 * \file atomic/fences.hpp
13 * This header contains definition of \c atomic_thread_fence and \c atomic_signal_fence functions.
16 #ifndef BOOST_ATOMIC_FENCES_HPP_INCLUDED_
17 #define BOOST_ATOMIC_FENCES_HPP_INCLUDED_
19 #include <boost/memory_order.hpp>
20 #include <boost/atomic/capabilities.hpp>
21 #include <boost/atomic/detail/fence_operations.hpp>
22 #include <boost/atomic/detail/header.hpp>
24 #ifdef BOOST_HAS_PRAGMA_ONCE
29 * IMPLEMENTATION NOTE: All interface functions MUST be declared with BOOST_FORCEINLINE,
30 * see comment for convert_memory_order_to_gcc in gcc_atomic_memory_order_utils.hpp.
37 BOOST_FORCEINLINE void atomic_thread_fence(memory_order order) BOOST_NOEXCEPT
39 atomics::detail::fence_operations::thread_fence(order);
42 BOOST_FORCEINLINE void atomic_signal_fence(memory_order order) BOOST_NOEXCEPT
44 atomics::detail::fence_operations::signal_fence(order);
47 } // namespace atomics
49 using atomics::atomic_thread_fence;
50 using atomics::atomic_signal_fence;
54 #include <boost/atomic/detail/footer.hpp>
56 #endif // BOOST_ATOMIC_FENCES_HPP_INCLUDED_