named_recursive_mutex.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #
  16. #if defined(BOOST_HAS_PRAGMA_ONCE)
  17. # pragma once
  18. #endif
  19. #include <boost/interprocess/detail/config_begin.hpp>
  20. #include <boost/interprocess/detail/workaround.hpp>
  21. #include <boost/interprocess/sync/windows/named_mutex.hpp>
  22. namespace boost {
  23. namespace interprocess {
  24. namespace ipcdetail {
  25. class windows_named_recursive_mutex
  26. //Windows mutexes based on CreateMutex are already recursive...
  27. : public windows_named_mutex
  28. {
  29. #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
  30. //Non-copyable
  31. windows_named_recursive_mutex();
  32. windows_named_recursive_mutex(const windows_named_mutex &);
  33. windows_named_recursive_mutex &operator=(const windows_named_mutex &);
  34. #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
  35. public:
  36. windows_named_recursive_mutex(create_only_t, const char *name, const permissions &perm = permissions())
  37. : windows_named_mutex(create_only_t(), name, perm)
  38. {}
  39. windows_named_recursive_mutex(open_or_create_t, const char *name, const permissions &perm = permissions())
  40. : windows_named_mutex(open_or_create_t(), name, perm)
  41. {}
  42. windows_named_recursive_mutex(open_only_t, const char *name)
  43. : windows_named_mutex(open_only_t(), name)
  44. {}
  45. };
  46. } //namespace ipcdetail {
  47. } //namespace interprocess {
  48. } //namespace boost {
  49. #include <boost/interprocess/detail/config_end.hpp>
  50. #endif //BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP