1 #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
2 #define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
9 // boost/detail/lwm_pthreads.hpp
11 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
13 // Permission to copy, use, modify, sell and distribute this software
14 // is granted provided this copyright notice appears in all copies.
15 // This software is provided "as is" without express or implied
16 // warranty, and with no claim as to its suitability for any purpose.
27 class lightweight_mutex
33 lightweight_mutex(lightweight_mutex const &);
34 lightweight_mutex & operator=(lightweight_mutex const &);
41 // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
43 #if defined(__hpux) && defined(_DECTHREADS_)
44 pthread_mutex_init(&m_, pthread_mutexattr_default);
46 pthread_mutex_init(&m_, 0);
52 pthread_mutex_destroy(&m_);
56 friend class scoped_lock;
64 scoped_lock(scoped_lock const &);
65 scoped_lock & operator=(scoped_lock const &);
69 scoped_lock(lightweight_mutex & m): m_(m.m_)
71 pthread_mutex_lock(&m_);
76 pthread_mutex_unlock(&m_);
85 #endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED