1 #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
\r
2 #define BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
\r
5 // Copyright (c) 2008 Peter Dimov
\r
7 // Distributed under the Boost Software License, Version 1.0.
\r
8 // See accompanying file LICENSE_1_0.txt or copy at
\r
9 // http://www.boost.org/LICENSE_1_0.txt)
\r
12 #include <boost/smart_ptr/detail/yield_k.hpp>
\r
32 __asm__ __volatile__(
\r
34 "=&r"( r ): // outputs
\r
35 "r"( 1 ), "r"( &v_ ): // inputs
\r
43 for( unsigned k = 0; !try_lock(); ++k )
\r
45 boost::detail::yield( k );
\r
51 __asm__ __volatile__( "" ::: "memory" );
\r
52 *const_cast< int volatile* >( &v_ ) = 0;
\r
63 scoped_lock( scoped_lock const & );
\r
64 scoped_lock & operator=( scoped_lock const & );
\r
68 explicit scoped_lock( spinlock & sp ): sp_( sp )
\r
80 } // namespace detail
\r
81 } // namespace boost
\r
83 #define BOOST_DETAIL_SPINLOCK_INIT {0}
\r
85 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
\r