Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:03:40

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * Copyright (c) 2011 Helge Bahmann
0007  * Copyright (c) 2013 Tim Blechmann
0008  * Copyright (c) 2014 Andrey Semashev
0009  */
0010 /*!
0011  * \file   atomic/fences.hpp
0012  *
0013  * This header contains definition of \c atomic_thread_fence and \c atomic_signal_fence functions.
0014  */
0015 
0016 #ifndef BOOST_ATOMIC_FENCES_HPP_INCLUDED_
0017 #define BOOST_ATOMIC_FENCES_HPP_INCLUDED_
0018 
0019 #include <boost/memory_order.hpp>
0020 #include <boost/atomic/capabilities.hpp>
0021 #include <boost/atomic/detail/fence_operations.hpp>
0022 #include <boost/atomic/detail/header.hpp>
0023 
0024 #ifdef BOOST_HAS_PRAGMA_ONCE
0025 #pragma once
0026 #endif
0027 
0028 /*
0029  * IMPLEMENTATION NOTE: All interface functions MUST be declared with BOOST_FORCEINLINE,
0030  *                      see comment for convert_memory_order_to_gcc in gcc_atomic_memory_order_utils.hpp.
0031  */
0032 
0033 namespace boost {
0034 
0035 namespace atomics {
0036 
0037 BOOST_FORCEINLINE void atomic_thread_fence(memory_order order) BOOST_NOEXCEPT
0038 {
0039     atomics::detail::fence_operations::thread_fence(order);
0040 }
0041 
0042 BOOST_FORCEINLINE void atomic_signal_fence(memory_order order) BOOST_NOEXCEPT
0043 {
0044     atomics::detail::fence_operations::signal_fence(order);
0045 }
0046 
0047 } // namespace atomics
0048 
0049 using atomics::atomic_thread_fence;
0050 using atomics::atomic_signal_fence;
0051 
0052 } // namespace boost
0053 
0054 #include <boost/atomic/detail/footer.hpp>
0055 
0056 #endif // BOOST_ATOMIC_FENCES_HPP_INCLUDED_