annotate DEPENDENCIES/generic/include/boost/thread/is_locked_by_this_thread.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // (C) Copyright 2012 Vicente J. Botet Escriba
Chris@16 2 // Distributed under the Boost Software License, Version 1.0. (See
Chris@16 3 // accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5
Chris@16 6
Chris@16 7 #ifndef BOOST_THREAD_IS_LOCKED_BY_THIS_THREAD_HPP
Chris@16 8 #define BOOST_THREAD_IS_LOCKED_BY_THIS_THREAD_HPP
Chris@16 9
Chris@16 10 #include <boost/thread/detail/config.hpp>
Chris@16 11
Chris@16 12 #include <boost/config/abi_prefix.hpp>
Chris@16 13
Chris@16 14 namespace boost
Chris@16 15 {
Chris@16 16 template <typename Lockable>
Chris@16 17 class testable_mutex;
Chris@16 18
Chris@16 19 /**
Chris@16 20 * Overloaded function used to check if the mutex is locked when it is testable and do nothing otherwise.
Chris@16 21 *
Chris@16 22 * This function is used usually to assert the pre-condition when the function can only be called when the mutex
Chris@16 23 * must be locked by the current thread.
Chris@16 24 */
Chris@16 25 template <typename Lockable>
Chris@16 26 bool is_locked_by_this_thread(testable_mutex<Lockable> const& mtx)
Chris@16 27 {
Chris@16 28 return mtx.is_locked_by_this_thread();
Chris@16 29 }
Chris@16 30 template <typename Lockable>
Chris@16 31 bool is_locked_by_this_thread(Lockable const&)
Chris@16 32 {
Chris@16 33 return true;
Chris@16 34 }
Chris@16 35 }
Chris@16 36
Chris@16 37 #include <boost/config/abi_suffix.hpp>
Chris@16 38
Chris@16 39 #endif // header