Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/thread/is_locked_by_this_thread.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // (C) Copyright 2012 Vicente J. Botet Escriba
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 
0007 #ifndef BOOST_THREAD_IS_LOCKED_BY_THIS_THREAD_HPP
0008 #define BOOST_THREAD_IS_LOCKED_BY_THIS_THREAD_HPP
0009 
0010 #include <boost/thread/detail/config.hpp>
0011 
0012 #include <boost/config/abi_prefix.hpp>
0013 
0014 namespace boost
0015 {
0016   template <typename Lockable>
0017   class testable_mutex;
0018 
0019   /**
0020    * Overloaded function used to check if the mutex is locked when it is testable and do nothing otherwise.
0021    *
0022    * This function is used usually to assert the pre-condition when the function can only be called when the mutex
0023    * must be locked by the current thread.
0024    */
0025   template <typename Lockable>
0026   bool is_locked_by_this_thread(testable_mutex<Lockable> const& mtx)
0027   {
0028     return mtx.is_locked_by_this_thread();
0029   }
0030   template <typename Lockable>
0031   bool is_locked_by_this_thread(Lockable const&)
0032   {
0033     return true;
0034   }
0035 }
0036 
0037 #include <boost/config/abi_suffix.hpp>
0038 
0039 #endif // header