named_recursive_mutex.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/interprocess for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP
  11. #define BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP
  12. #if (defined _MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif
  15. #include <boost/interprocess/detail/config_begin.hpp>
  16. #include <boost/interprocess/detail/workaround.hpp>
  17. #include <boost/interprocess/sync/windows/named_mutex.hpp>
  18. namespace boost {
  19. namespace interprocess {
  20. namespace ipcdetail {
  21. class windows_named_recursive_mutex
  22. //Windows mutexes based on CreateMutex are already recursive...
  23. : public windows_named_mutex
  24. {
  25. /// @cond
  26. //Non-copyable
  27. windows_named_recursive_mutex();
  28. windows_named_recursive_mutex(const windows_named_mutex &);
  29. windows_named_recursive_mutex &operator=(const windows_named_mutex &);
  30. /// @endcond
  31. public:
  32. windows_named_recursive_mutex(create_only_t, const char *name, const permissions &perm = permissions())
  33. : windows_named_mutex(create_only_t(), name, perm)
  34. {}
  35. windows_named_recursive_mutex(open_or_create_t, const char *name, const permissions &perm = permissions())
  36. : windows_named_mutex(open_or_create_t(), name, perm)
  37. {}
  38. windows_named_recursive_mutex(open_only_t, const char *name)
  39. : windows_named_mutex(open_only_t(), name)
  40. {}
  41. };
  42. } //namespace ipcdetail {
  43. } //namespace interprocess {
  44. } //namespace boost {
  45. #include <boost/interprocess/detail/config_end.hpp>
  46. #endif //BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP