1 // (C) Copyright 2012 Vicente J. Botet Escriba
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_THREAD_IS_LOCKED_BY_THIS_THREAD_HPP
8 #define BOOST_THREAD_IS_LOCKED_BY_THIS_THREAD_HPP
10 #include <boost/thread/detail/config.hpp>
12 #include <boost/config/abi_prefix.hpp>
16 template <typename Lockable>
20 * Overloaded function used to check if the mutex is locked when it is testable and do nothing otherwise.
22 * This function is used usually to assert the pre-condition when the function can only be called when the mutex
23 * must be locked by the current thread.
25 template <typename Lockable>
26 bool is_locked_by_this_thread(testable_mutex<Lockable> const& mtx)
28 return mtx.is_locked_by_this_thread();
30 template <typename Lockable>
31 bool is_locked_by_this_thread(Lockable const&)
37 #include <boost/config/abi_suffix.hpp>