recursive_mutex.hpp 1.5 KB

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