Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED
0002 #define BOOST_SMART_PTR_DETAIL_SPINLOCK_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/spinlock.hpp
0012 //
0013 //  Copyright (c) 2008 Peter Dimov
0014 //
0015 //  Distributed under the Boost Software License, Version 1.0.
0016 //  See accompanying file LICENSE_1_0.txt or copy at
0017 //  http://www.boost.org/LICENSE_1_0.txt)
0018 //
0019 //  struct spinlock
0020 //  {
0021 //      void lock();
0022 //      bool try_lock();
0023 //      void unlock();
0024 //
0025 //      class scoped_lock;
0026 //  };
0027 //
0028 //  #define BOOST_DETAIL_SPINLOCK_INIT <unspecified>
0029 //
0030 
0031 #include <boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp>
0032 #include <boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp>
0033 #include <boost/config.hpp>
0034 
0035 #if defined( BOOST_SP_USE_STD_ATOMIC )
0036 #  include <boost/smart_ptr/detail/spinlock_std_atomic.hpp>
0037 
0038 #elif defined( BOOST_SP_USE_PTHREADS )
0039 #  include <boost/smart_ptr/detail/spinlock_pt.hpp>
0040 
0041 #elif defined( BOOST_SP_HAS_GCC_INTRINSICS )
0042 #  include <boost/smart_ptr/detail/spinlock_gcc_atomic.hpp>
0043 
0044 #elif !defined( BOOST_NO_CXX11_HDR_ATOMIC )
0045 #  include <boost/smart_ptr/detail/spinlock_std_atomic.hpp>
0046 
0047 #elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
0048 #  include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>
0049 
0050 #elif defined( BOOST_SP_HAS_SYNC_INTRINSICS )
0051 #  include <boost/smart_ptr/detail/spinlock_sync.hpp>
0052 
0053 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
0054 #  include <boost/smart_ptr/detail/spinlock_w32.hpp>
0055 
0056 #elif defined(BOOST_HAS_PTHREADS)
0057 #  include <boost/smart_ptr/detail/spinlock_pt.hpp>
0058 
0059 #elif !defined(BOOST_HAS_THREADS)
0060 #  include <boost/smart_ptr/detail/spinlock_nt.hpp>
0061 
0062 #else
0063 #  error Unrecognized threading platform
0064 #endif
0065 
0066 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED