1 #ifndef BOOST_DETAIL_SPINLOCK_PT_HPP_INCLUDED
2 #define BOOST_DETAIL_SPINLOCK_PT_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
11 // Copyright (c) 2008 Peter Dimov
13 // Distributed under the Boost Software License, Version 1.0.
14 // See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
36 return pthread_mutex_trylock( &v_ ) == 0;
41 pthread_mutex_lock( &v_ );
46 pthread_mutex_unlock( &v_ );
57 scoped_lock( scoped_lock const & );
58 scoped_lock & operator=( scoped_lock const & );
62 explicit scoped_lock( spinlock & sp ): sp_( sp )
77 #define BOOST_DETAIL_SPINLOCK_INIT { PTHREAD_MUTEX_INITIALIZER }
79 #endif // #ifndef BOOST_DETAIL_SPINLOCK_PT_HPP_INCLUDED