recursive_mutex.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef BOOST_RECURSIVE_MUTEX_WIN32_HPP
  2. #define BOOST_RECURSIVE_MUTEX_WIN32_HPP
  3. // recursive_mutex.hpp
  4. //
  5. // (C) Copyright 2006-7 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/win32/basic_recursive_mutex.hpp>
  11. #include <boost/thread/exceptions.hpp>
  12. #include <boost/thread/detail/delete.hpp>
  13. #if defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
  14. #include <boost/thread/lock_types.hpp>
  15. #endif
  16. #include <boost/config/abi_prefix.hpp>
  17. namespace boost
  18. {
  19. class recursive_mutex:
  20. public ::boost::detail::basic_recursive_mutex
  21. {
  22. public:
  23. BOOST_THREAD_NO_COPYABLE(recursive_mutex)
  24. recursive_mutex()
  25. {
  26. ::boost::detail::basic_recursive_mutex::initialize();
  27. }
  28. ~recursive_mutex()
  29. {
  30. ::boost::detail::basic_recursive_mutex::destroy();
  31. }
  32. #if defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
  33. typedef unique_lock<recursive_mutex> scoped_lock;
  34. typedef detail::try_lock_wrapper<recursive_mutex> scoped_try_lock;
  35. #endif
  36. };
  37. typedef recursive_mutex recursive_try_mutex;
  38. class recursive_timed_mutex:
  39. public ::boost::detail::basic_recursive_timed_mutex
  40. {
  41. public:
  42. BOOST_THREAD_NO_COPYABLE(recursive_timed_mutex)
  43. recursive_timed_mutex()
  44. {
  45. ::boost::detail::basic_recursive_timed_mutex::initialize();
  46. }
  47. ~recursive_timed_mutex()
  48. {
  49. ::boost::detail::basic_recursive_timed_mutex::destroy();
  50. }
  51. #if defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
  52. typedef unique_lock<recursive_timed_mutex> scoped_timed_lock;
  53. typedef detail::try_lock_wrapper<recursive_timed_mutex> scoped_try_lock;
  54. typedef scoped_timed_lock scoped_lock;
  55. #endif
  56. };
  57. }
  58. #include <boost/config/abi_suffix.hpp>
  59. #endif