summaryrefslogtreecommitdiff
path: root/boost/interprocess/sync/named_recursive_mutex.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/interprocess/sync/named_recursive_mutex.hpp')
-rw-r--r--boost/interprocess/sync/named_recursive_mutex.hpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/boost/interprocess/sync/named_recursive_mutex.hpp b/boost/interprocess/sync/named_recursive_mutex.hpp
index 28768cea6f..2d4b9b2416 100644
--- a/boost/interprocess/sync/named_recursive_mutex.hpp
+++ b/boost/interprocess/sync/named_recursive_mutex.hpp
@@ -20,7 +20,12 @@
#include <boost/interprocess/creation_tags.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <boost/interprocess/permissions.hpp>
-#include <boost/interprocess/sync/shm/named_recursive_mutex.hpp>
+#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/named_recursive_mutex.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
+#else
+ #include <boost/interprocess/sync/shm/named_recursive_mutex.hpp>
+#endif
//!\file
//!Describes a named named_recursive_mutex class for inter-process synchronization
@@ -32,7 +37,7 @@ namespace interprocess {
namespace ipcdetail{ class interprocess_tester; }
/// @endcond
-//!A recursive mutex with a global name, so it can be found from different
+//!A recursive mutex with a global name, so it can be found from different
//!processes. This mutex can't be placed in shared memory, and
//!each process should have it's own named_recursive_mutex.
class named_recursive_mutex
@@ -49,7 +54,7 @@ class named_recursive_mutex
//!If the recursive_mutex can't be created throws interprocess_exception
named_recursive_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global recursive_mutex with a name.
+ //!Opens or creates a global recursive_mutex with a name.
//!If the recursive_mutex is created, this call is equivalent to
//!named_recursive_mutex(create_only_t, ... )
//!If the recursive_mutex is already created, this call is equivalent
@@ -78,7 +83,7 @@ class named_recursive_mutex
//!Throws interprocess_exception if a severe error is found.
void lock();
- //!Tries to lock the named_recursive_mutex, returns false when named_recursive_mutex
+ //!Tries to lock the named_recursive_mutex, returns false when named_recursive_mutex
//!is already locked, returns true when success.
//!Throws interprocess_exception if a severe error is found.
bool try_lock();
@@ -97,7 +102,12 @@ class named_recursive_mutex
friend class ipcdetail::interprocess_tester;
void dont_close_on_destruction();
- typedef ipcdetail::shm_named_recursive_mutex impl_t;
+ #if defined(BOOST_INTERPROCESS_USE_WINDOWS)
+ typedef ipcdetail::windows_named_recursive_mutex impl_t;
+ #undef BOOST_INTERPROCESS_USE_WINDOWS
+ #else
+ typedef ipcdetail::shm_named_recursive_mutex impl_t;
+ #endif
impl_t m_mut;
/// @endcond