1 #ifndef BOOST_PTHREAD_MUTEX_SCOPED_LOCK_HPP
2 #define BOOST_PTHREAD_MUTEX_SCOPED_LOCK_HPP
3 // (C) Copyright 2007-8 Anthony Williams
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/assert.hpp>
12 #include <boost/config/abi_prefix.hpp>
18 class pthread_mutex_scoped_lock
23 explicit pthread_mutex_scoped_lock(pthread_mutex_t* m_):
26 BOOST_VERIFY(!pthread_mutex_lock(m));
30 BOOST_VERIFY(!pthread_mutex_unlock(m));
34 ~pthread_mutex_scoped_lock()
44 class pthread_mutex_scoped_unlock
48 explicit pthread_mutex_scoped_unlock(pthread_mutex_t* m_):
51 BOOST_VERIFY(!pthread_mutex_unlock(m));
53 ~pthread_mutex_scoped_unlock()
55 BOOST_VERIFY(!pthread_mutex_lock(m));
62 #include <boost/config/abi_suffix.hpp>