2 // boost/signals2/detail/lwm_pthreads.hpp
4 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
5 // Copyright (c) 2008 Frank Mori Hess
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
12 #ifndef BOOST_SIGNALS2_LWM_PTHREADS_HPP
13 #define BOOST_SIGNALS2_LWM_PTHREADS_HPP
15 // MS compatible compilers support #pragma once
21 #include <boost/assert.hpp>
37 mutex & operator=(mutex const &);
44 // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
46 #if defined(__hpux) && defined(_DECTHREADS_)
47 BOOST_VERIFY(pthread_mutex_init(&m_, pthread_mutexattr_default) == 0);
49 BOOST_VERIFY(pthread_mutex_init(&m_, 0) == 0);
55 BOOST_VERIFY(pthread_mutex_destroy(&m_) == 0);
60 BOOST_VERIFY(pthread_mutex_lock(&m_) == 0);
65 return pthread_mutex_trylock(&m_) == 0;
70 BOOST_VERIFY(pthread_mutex_unlock(&m_) == 0);
74 } // namespace signals2
78 #endif // #ifndef BOOST_SIGNALS2_LWM_PTHREADS_HPP