atomic.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright (C) 2011-2013, 2016 Tim Blechmann
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_LOCKFREE_DETAIL_ATOMIC_HPP
  7. #define BOOST_LOCKFREE_DETAIL_ATOMIC_HPP
  8. #if defined( BOOST_LOCKFREE_FORCE_BOOST_ATOMIC )
  9. # include <boost/atomic.hpp>
  10. #else
  11. # include <atomic>
  12. #endif
  13. namespace boost { namespace lockfree {
  14. namespace detail {
  15. #if defined( BOOST_LOCKFREE_FORCE_BOOST_ATOMIC )
  16. using boost::atomic;
  17. using boost::memory_order_acquire;
  18. using boost::memory_order_consume;
  19. using boost::memory_order_relaxed;
  20. using boost::memory_order_release;
  21. #else
  22. using std::atomic;
  23. using std::memory_order_acquire;
  24. using std::memory_order_consume;
  25. using std::memory_order_relaxed;
  26. using std::memory_order_release;
  27. #endif
  28. } // namespace detail
  29. using detail::atomic;
  30. using detail::memory_order_acquire;
  31. using detail::memory_order_consume;
  32. using detail::memory_order_relaxed;
  33. using detail::memory_order_release;
  34. }} // namespace boost::lockfree
  35. #endif /* BOOST_LOCKFREE_DETAIL_ATOMIC_HPP */