Chris@16: #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED Chris@16: #define BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1020) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: // Chris@16: // boost/detail/spinlock.hpp Chris@16: // Chris@16: // Copyright (c) 2008 Peter Dimov Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // struct spinlock Chris@16: // { Chris@16: // void lock(); Chris@16: // bool try_lock(); Chris@16: // void unlock(); Chris@16: // Chris@16: // class scoped_lock; Chris@16: // }; Chris@16: // Chris@16: // #define BOOST_DETAIL_SPINLOCK_INIT Chris@16: // Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@101: #if defined( BOOST_SP_USE_STD_ATOMIC ) Chris@101: # if !defined( __clang__ ) Chris@101: # include Chris@101: # else Chris@101: // Clang (at least up to 3.4) can't compile spinlock_pool when Chris@101: // using std::atomic, so substitute the __sync implementation instead. Chris@101: # include Chris@101: # endif Chris@101: Chris@101: #elif defined( BOOST_SP_USE_PTHREADS ) Chris@16: # include Chris@16: Chris@16: #elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ ) Chris@16: # include Chris@16: Chris@16: #elif defined( BOOST_SP_HAS_SYNC ) Chris@16: # include Chris@16: Chris@16: #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) Chris@16: # include Chris@16: Chris@16: #elif defined(BOOST_HAS_PTHREADS) Chris@16: # include Chris@16: Chris@16: #elif !defined(BOOST_HAS_THREADS) Chris@16: # include Chris@16: Chris@16: #else Chris@16: # error Unrecognized threading platform Chris@16: #endif Chris@16: Chris@16: #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED