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