Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-07 09:56:40

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/smart_ptr/detail/deprecated_macros.hpp>
0049 #include <boost/config.hpp>
0050 
0051 #if defined( BOOST_AC_DISABLE_THREADS )
0052 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0053 
0054 #elif defined( BOOST_AC_USE_STD_ATOMIC )
0055 # include <boost/smart_ptr/detail/atomic_count_std_atomic.hpp>
0056 
0057 #elif defined( BOOST_AC_USE_SPINLOCK )
0058 # include <boost/smart_ptr/detail/atomic_count_spin.hpp>
0059 
0060 #elif defined( BOOST_AC_USE_PTHREADS )
0061 # include <boost/smart_ptr/detail/atomic_count_pt.hpp>
0062 
0063 #elif defined( BOOST_SP_DISABLE_THREADS )
0064 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0065 
0066 #elif defined( BOOST_SP_USE_STD_ATOMIC )
0067 # include <boost/smart_ptr/detail/atomic_count_std_atomic.hpp>
0068 
0069 #elif defined( BOOST_SP_USE_SPINLOCK )
0070 # include <boost/smart_ptr/detail/atomic_count_spin.hpp>
0071 
0072 #elif defined( BOOST_SP_USE_PTHREADS )
0073 # include <boost/smart_ptr/detail/atomic_count_pt.hpp>
0074 
0075 #elif defined( BOOST_DISABLE_THREADS ) && !defined( BOOST_SP_ENABLE_THREADS ) && !defined( BOOST_DISABLE_WIN32 )
0076 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0077 
0078 #elif defined( BOOST_SP_HAS_GCC_INTRINSICS )
0079 # include <boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp>
0080 
0081 #elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
0082 # include <boost/smart_ptr/detail/atomic_count_std_atomic.hpp>
0083 
0084 #elif defined( BOOST_SP_HAS_SYNC_INTRINSICS )
0085 # include <boost/smart_ptr/detail/atomic_count_sync.hpp>
0086 
0087 #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined( __PATHSCALE__ )
0088 # include <boost/smart_ptr/detail/atomic_count_gcc_x86.hpp>
0089 
0090 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
0091 # include <boost/smart_ptr/detail/atomic_count_win32.hpp>
0092 
0093 #elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
0094 # include <boost/smart_ptr/detail/atomic_count_gcc.hpp>
0095 
0096 #elif !defined( BOOST_HAS_THREADS )
0097 # include <boost/smart_ptr/detail/atomic_count_nt.hpp>
0098 
0099 #else
0100 # include <boost/smart_ptr/detail/atomic_count_spin.hpp>
0101 
0102 #endif
0103 
0104 #endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_HPP_INCLUDED