1 /* 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) 5 * 6 * Copyright (c) 2020 Andrey Semashev 7 */ 8 /*! 9 * \file atomic/detail/fence_operations_emulated.hpp 10 * 11 * This header contains implementation of the \c fence_operations struct. 12 */ 13 14 #ifndef BOOST_ATOMIC_DETAIL_FENCE_OPERATIONS_EMULATED_HPP_INCLUDED_ 15 #define BOOST_ATOMIC_DETAIL_FENCE_OPERATIONS_EMULATED_HPP_INCLUDED_ 16 17 #include <boost/memory_order.hpp> 18 #include <boost/atomic/detail/config.hpp> 19 #include <boost/atomic/detail/lock_pool.hpp> 20 #include <boost/atomic/detail/header.hpp> 21 22 #ifdef BOOST_HAS_PRAGMA_ONCE 23 #pragma once 24 #endif 25 26 namespace boost { 27 namespace atomics { 28 namespace detail { 29 30 //! Fence operations based on lock pool 31 struct fence_operations_emulated 32 { thread_fenceboost::atomics::detail::fence_operations_emulated33 static BOOST_FORCEINLINE void thread_fence(memory_order) BOOST_NOEXCEPT 34 { 35 atomics::detail::lock_pool::thread_fence(); 36 } 37 signal_fenceboost::atomics::detail::fence_operations_emulated38 static BOOST_FORCEINLINE void signal_fence(memory_order) BOOST_NOEXCEPT 39 { 40 atomics::detail::lock_pool::signal_fence(); 41 } 42 }; 43 44 } // namespace detail 45 } // namespace atomics 46 } // namespace boost 47 48 #include <boost/atomic/detail/footer.hpp> 49 50 #endif // BOOST_ATOMIC_DETAIL_FENCE_OPERATIONS_EMULATED_HPP_INCLUDED_ 51