1 #ifndef BOOST_THREAD_RECURSIVE_MUTEX_HPP 2 #define BOOST_THREAD_RECURSIVE_MUTEX_HPP 3 4 // recursive_mutex.hpp 5 // 6 // (C) Copyright 2007 Anthony Williams 7 // 8 // Distributed under the Boost Software License, Version 1.0. (See 9 // accompanying file LICENSE_1_0.txt or copy at 10 // http://www.boost.org/LICENSE_1_0.txt) 11 12 #include <boost/thread/detail/platform.hpp> 13 #if defined(BOOST_THREAD_PLATFORM_WIN32) 14 #include <boost/thread/win32/recursive_mutex.hpp> 15 #elif defined(BOOST_THREAD_PLATFORM_PTHREAD) 16 #include <boost/thread/pthread/recursive_mutex.hpp> 17 #else 18 #error "Boost threads unavailable on this platform" 19 #endif 20 21 #include <boost/thread/lockable_traits.hpp> 22 23 namespace boost 24 { 25 namespace sync 26 { 27 28 #ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES 29 template<> 30 struct is_basic_lockable<recursive_mutex> 31 { 32 BOOST_STATIC_CONSTANT(bool, value = true); 33 }; 34 template<> 35 struct is_lockable<recursive_mutex> 36 { 37 BOOST_STATIC_CONSTANT(bool, value = true); 38 }; 39 template<> 40 struct is_basic_lockable<recursive_timed_mutex> 41 { 42 BOOST_STATIC_CONSTANT(bool, value = true); 43 }; 44 template<> 45 struct is_lockable<recursive_timed_mutex> 46 { 47 BOOST_STATIC_CONSTANT(bool, value = true); 48 }; 49 #endif 50 51 template<> 52 struct is_recursive_mutex_sur_parolle<recursive_mutex> 53 { 54 BOOST_STATIC_CONSTANT(bool, value = true); 55 }; 56 template<> 57 struct is_recursive_mutex_sur_parolle<recursive_timed_mutex> 58 { 59 BOOST_STATIC_CONSTANT(bool, value = true); 60 }; 61 62 } 63 } 64 #endif 65