1 // Distributed under the Boost Software License, Version 1.0. (See
2 // accompanying file LICENSE_1_0.txt or copy at
3 // http://www.boost.org/LICENSE_1_0.txt)
4 // (C) Copyright 2012 Vicente J. Botet Escriba
6 #ifndef BOOST_THREAD_REVERSE_LOCK_HPP
7 #define BOOST_THREAD_REVERSE_LOCK_HPP
8 #include <boost/thread/detail/config.hpp>
9 #include <boost/thread/detail/move.hpp>
10 #include <boost/thread/lockable_traits.hpp>
11 #include <boost/thread/lock_options.hpp>
12 #include <boost/thread/detail/delete.hpp>
17 template<typename Lock>
21 typedef typename Lock::mutex_type mutex_type;
22 BOOST_THREAD_NO_COPYABLE(reverse_lock)
24 explicit reverse_lock(Lock& m_)
37 m = BOOST_THREAD_MAKE_RV_REF(Lock(*mtx, adopt_lock));
47 #ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
49 struct is_mutex_type<reverse_lock<T> >
51 BOOST_STATIC_CONSTANT(bool, value = true);