00001 #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED 00002 #define BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED 00003 00004 // MS compatible compilers support #pragma once 00005 00006 #if defined(_MSC_VER) && (_MSC_VER >= 1020) 00007 # pragma once 00008 #endif 00009 00010 // 00011 // boost/detail/spinlock.hpp 00012 // 00013 // Copyright (c) 2008 Peter Dimov 00014 // 00015 // Distributed under the Boost Software License, Version 1.0. 00016 // See accompanying file LICENSE_1_0.txt or copy at 00017 // http://www.boost.org/LICENSE_1_0.txt) 00018 // 00019 // struct spinlock 00020 // { 00021 // void lock(); 00022 // bool try_lock(); 00023 // void unlock(); 00024 // 00025 // class scoped_lock; 00026 // }; 00027 // 00028 // #define BOOST_DETAIL_SPINLOCK_INIT <unspecified> 00029 // 00030 00031 #include <boost/config.hpp> 00032 #include <boost/smart_ptr/detail/sp_has_sync.hpp> 00033 00034 #if defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ ) 00035 # include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp> 00036 00037 #elif defined( BOOST_SP_HAS_SYNC ) 00038 # include <boost/smart_ptr/detail/spinlock_sync.hpp> 00039 00040 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 00041 # include <boost/smart_ptr/detail/spinlock_w32.hpp> 00042 00043 #elif defined(BOOST_HAS_PTHREADS) 00044 # include <boost/smart_ptr/detail/spinlock_pt.hpp> 00045 00046 #elif !defined(BOOST_HAS_THREADS) 00047 # include <boost/smart_ptr/detail/spinlock_nt.hpp> 00048 00049 #else 00050 # error Unrecognized threading platform 00051 #endif 00052 00053 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED