Debian Codegraph @

third-party/boost-math/include/boost/math/tools/atomic.hpp

raw
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright 2017 John Maddock
3 // Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #ifndef BOOST_MATH_ATOMIC_DETAIL_HPP
8 #define BOOST_MATH_ATOMIC_DETAIL_HPP
9
10 #include <boost/math/tools/config.hpp>
11 #include <boost/math/tools/cxx03_warn.hpp>
12
13 #ifdef BOOST_MATH_HAS_THREADS
14 #include <atomic>
15
16 namespace boost {
17 namespace math {
18 namespace detail {
19 #if (ATOMIC_INT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
20 typedef std::atomic<int> atomic_counter_type;
21 typedef std::atomic<unsigned> atomic_unsigned_type;
22 typedef int atomic_integer_type;
23 typedef unsigned atomic_unsigned_integer_type;
24 #elif (ATOMIC_SHORT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
25 typedef std::atomic<short> atomic_counter_type;
26 typedef std::atomic<unsigned short> atomic_unsigned_type;
27 typedef short atomic_integer_type;
28 typedef unsigned short atomic_unsigned_type;
29 #elif (ATOMIC_LONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
30 typedef std::atomic<long> atomic_unsigned_integer_type;
31 typedef std::atomic<unsigned long> atomic_unsigned_type;
32 typedef unsigned long atomic_unsigned_type;
33 typedef long atomic_integer_type;
34 #elif (ATOMIC_LLONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
35 typedef std::atomic<long long> atomic_unsigned_integer_type;
36 typedef std::atomic<unsigned long long> atomic_unsigned_type;
37 typedef long long atomic_integer_type;
38 typedef unsigned long long atomic_unsigned_integer_type;
39 #elif !defined(BOOST_MATH_NO_ATOMIC_INT)
40 # define BOOST_MATH_NO_ATOMIC_INT
41 #endif
42 } // Namespace detail
43 } // Namespace math
44 } // Namespace boost
45
46 #else
47 # define BOOST_MATH_NO_ATOMIC_INT
48 #endif // BOOST_MATH_HAS_THREADS
49
50 #endif // BOOST_MATH_ATOMIC_DETAIL_HPP