File indexing completed on 2025-01-18 09:40:39
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_MATH_ATOMIC_DETAIL_HPP
0008 #define BOOST_MATH_ATOMIC_DETAIL_HPP
0009
0010 #include <boost/math/tools/config.hpp>
0011 #include <boost/math/tools/cxx03_warn.hpp>
0012
0013 #ifdef BOOST_HAS_THREADS
0014 #include <atomic>
0015
0016 namespace boost {
0017 namespace math {
0018 namespace detail {
0019 #if (ATOMIC_INT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
0020 typedef std::atomic<int> atomic_counter_type;
0021 typedef std::atomic<unsigned> atomic_unsigned_type;
0022 typedef int atomic_integer_type;
0023 typedef unsigned atomic_unsigned_integer_type;
0024 #elif (ATOMIC_SHORT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
0025 typedef std::atomic<short> atomic_counter_type;
0026 typedef std::atomic<unsigned short> atomic_unsigned_type;
0027 typedef short atomic_integer_type;
0028 typedef unsigned short atomic_unsigned_type;
0029 #elif (ATOMIC_LONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
0030 typedef std::atomic<long> atomic_unsigned_integer_type;
0031 typedef std::atomic<unsigned long> atomic_unsigned_type;
0032 typedef unsigned long atomic_unsigned_type;
0033 typedef long atomic_integer_type;
0034 #elif (ATOMIC_LLONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
0035 typedef std::atomic<long long> atomic_unsigned_integer_type;
0036 typedef std::atomic<unsigned long long> atomic_unsigned_type;
0037 typedef long long atomic_integer_type;
0038 typedef unsigned long long atomic_unsigned_integer_type;
0039 #elif !defined(BOOST_MATH_NO_ATOMIC_INT)
0040 # define BOOST_MATH_NO_ATOMIC_INT
0041 #endif
0042 }
0043 }
0044 }
0045
0046 #else
0047 # define BOOST_MATH_NO_ATOMIC_INT
0048 #endif
0049
0050 #endif