1 #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_NT_HPP_INCLUDED
\r
2 #define BOOST_SMART_PTR_DETAIL_SPINLOCK_NT_HPP_INCLUDED
\r
4 // MS compatible compilers support #pragma once
\r
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
\r
11 // Copyright (c) 2008 Peter Dimov
\r
13 // Distributed under the Boost Software License, Version 1.0.
\r
14 // See accompanying file LICENSE_1_0.txt or copy at
\r
15 // http://www.boost.org/LICENSE_1_0.txt)
\r
18 #include <boost/assert.hpp>
\r
34 inline bool try_lock()
\r
49 BOOST_ASSERT( !locked_ );
\r
53 inline void unlock()
\r
55 BOOST_ASSERT( locked_ );
\r
67 scoped_lock( scoped_lock const & );
\r
68 scoped_lock & operator=( scoped_lock const & );
\r
72 explicit scoped_lock( spinlock & sp ): sp_( sp )
\r
84 } // namespace detail
\r
85 } // namespace boost
\r
87 #define BOOST_DETAIL_SPINLOCK_INIT { false }
\r
89 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_NT_HPP_INCLUDED
\r