1 #ifndef BOOST_SMART_PTR_DETAIL_LWM_PTHREADS_HPP_INCLUDED
2 #define BOOST_SMART_PTR_DETAIL_LWM_PTHREADS_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
11 // boost/detail/lwm_pthreads.hpp
13 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
15 // Distributed under the Boost Software License, Version 1.0. (See
16 // accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
20 #include <boost/assert.hpp>
29 class lightweight_mutex
35 lightweight_mutex(lightweight_mutex const &);
36 lightweight_mutex & operator=(lightweight_mutex const &);
43 // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
45 #if defined(__hpux) && defined(_DECTHREADS_)
46 BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 );
48 BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 );
54 BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 );
58 friend class scoped_lock;
66 scoped_lock(scoped_lock const &);
67 scoped_lock & operator=(scoped_lock const &);
71 scoped_lock(lightweight_mutex & m): m_(m.m_)
73 BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
78 BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
87 #endif // #ifndef BOOST_SMART_PTR_DETAIL_LWM_PTHREADS_HPP_INCLUDED