Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:42

0001 #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
0002 #define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
0003 
0004 // MS compatible compilers support #pragma once
0005 
0006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
0007 # pragma once
0008 #endif
0009 
0010 //
0011 //  boost/detail/atomic_count.hpp - thread/SMP safe reference counter
0012 //
0013 //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
0014 //  Copyright (c) 2013 Peter Dimov
0015 //
0016 //  Distributed under the Boost Software License, Version 1.0.
0017 //  See accompanying file LICENSE_1_0.txt or copy at
0018 //  http://www.boost.org/LICENSE_1_0.txt
0019 //
0020 //  typedef <implementation-defined> boost::detail::atomic_count;
0021 //
0022 //  atomic_count a(n);
0023 //
0024 //    (n is convertible to long)
0025 //
0026 //    Effects: Constructs an atomic_count with an initial value of n
0027 //
0028 //  a;
0029 //
0030 //    Returns: (long) the current value of a
0031 //    Memory Ordering: acquire
0032 //
0033 //  ++a;
0034 //
0035 //    Effects: Atomically increments the value of a
0036 //    Returns: (long) the new value of a
0037 //    Memory Ordering: acquire/release
0038 //
0039 //  --a;
0040 //
0041 //    Effects: Atomically decrements the value of a
0042 //    Returns: (long) the new value of a
0043 //    Memory Ordering: acquire/release
0044 //
0045 
0046 #include <boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp>
0047 #include <boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp>
0048 #include <boost/config.hpp>
0049 
0050 #if defined( BOOST_AC_DISABLE_THREADS )
0051 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0052 
0053 #elif defined( BOOST_AC_USE_STD_ATOMIC )
0054 # include <boost/smart_ptr/detail/atomic_count_std_atomic.hpp>
0055 
0056 #elif defined( BOOST_AC_USE_SPINLOCK )
0057 # include <boost/smart_ptr/detail/atomic_count_spin.hpp>
0058 
0059 #elif defined( BOOST_AC_USE_PTHREADS )
0060 # include <boost/smart_ptr/detail/atomic_count_pt.hpp>
0061 
0062 #elif defined( BOOST_SP_DISABLE_THREADS )
0063 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0064 
0065 #elif defined( BOOST_SP_USE_STD_ATOMIC )
0066 # include <boost/smart_ptr/detail/atomic_count_std_atomic.hpp>
0067 
0068 #elif defined( BOOST_SP_USE_SPINLOCK )
0069 # include <boost/smart_ptr/detail/atomic_count_spin.hpp>
0070 
0071 #elif defined( BOOST_SP_USE_PTHREADS )
0072 # include <boost/smart_ptr/detail/atomic_count_pt.hpp>
0073 
0074 #elif defined( BOOST_DISABLE_THREADS ) && !defined( BOOST_SP_ENABLE_THREADS ) && !defined( BOOST_DISABLE_WIN32 )
0075 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0076 
0077 #elif defined( BOOST_SP_HAS_GCC_INTRINSICS )
0078 # include <boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp>
0079 
0080 #elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
0081 # include <boost/smart_ptr/detail/atomic_count_std_atomic.hpp>
0082 
0083 #elif defined( BOOST_SP_HAS_SYNC_INTRINSICS )
0084 # include <boost/smart_ptr/detail/atomic_count_sync.hpp>
0085 
0086 #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined( __PATHSCALE__ )
0087 # include <boost/smart_ptr/detail/atomic_count_gcc_x86.hpp>
0088 
0089 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
0090 # include <boost/smart_ptr/detail/atomic_count_win32.hpp>
0091 
0092 #elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
0093 # include <boost/smart_ptr/detail/atomic_count_gcc.hpp>
0094 
0095 #elif !defined( BOOST_HAS_THREADS )
0096 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0097 
0098 #else
0099 # include <boost/smart_ptr/detail/atomic_count_spin.hpp>
0100 
0101 #endif
0102 
0103 #endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_HPP_INCLUDED