diff options
Diffstat (limited to 'boost/interprocess/sync/named_mutex.hpp')
-rw-r--r-- | boost/interprocess/sync/named_mutex.hpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/boost/interprocess/sync/named_mutex.hpp b/boost/interprocess/sync/named_mutex.hpp index c34193c697..e91b1f4d8f 100644 --- a/boost/interprocess/sync/named_mutex.hpp +++ b/boost/interprocess/sync/named_mutex.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // @@ -11,7 +11,7 @@ #ifndef BOOST_INTERPROCESS_NAMED_MUTEX_HPP #define BOOST_INTERPROCESS_NAMED_MUTEX_HPP -#if (defined _MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif @@ -46,17 +46,17 @@ class named_condition; //!each process should have it's own named_mutex. class named_mutex { - /// @cond + #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) //Non-copyable named_mutex(); named_mutex(const named_mutex &); named_mutex &operator=(const named_mutex &); friend class named_condition; - /// @endcond + #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED public: - //!Creates a global interprocess_mutex with a name. + //!Creates a global mutex with a name. //!Throws interprocess_exception on error. named_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions()); @@ -82,19 +82,19 @@ class named_mutex ~named_mutex(); //!Unlocks a previously locked - //!interprocess_mutex. + //!mutex. void unlock(); - //!Locks interprocess_mutex, sleeps when interprocess_mutex is already locked. + //!Locks the mutex, sleeps when the mutex is already locked. //!Throws interprocess_exception if a severe error is found void lock(); - //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex + //!Tries to lock the mutex, returns false when the mutex //!is already locked, returns true when success. //!Throws interprocess_exception if a severe error is found bool try_lock(); - //!Tries to lock the interprocess_mutex until time abs_time, + //!Tries to lock the the mutex until time abs_time, //!Returns false when timeout expires, returns true when locks. //!Throws interprocess_exception if a severe error is found bool timed_lock(const boost::posix_time::ptime &abs_time); @@ -103,31 +103,30 @@ class named_mutex //!Returns false on error. Never throws. static bool remove(const char *name); - /// @cond + #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) private: friend class ipcdetail::interprocess_tester; void dont_close_on_destruction(); + public: #if defined(BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES) - typedef ipcdetail::posix_named_mutex impl_t; - impl_t m_mut; + typedef ipcdetail::posix_named_mutex internal_mutex_type; #undef BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES #elif defined(BOOST_INTERPROCESS_USE_WINDOWS) - typedef ipcdetail::windows_named_mutex impl_t; - impl_t m_mut; + typedef ipcdetail::windows_named_mutex internal_mutex_type; #undef BOOST_INTERPROCESS_USE_WINDOWS #else - typedef ipcdetail::shm_named_mutex impl_t; - impl_t m_mut; - public: - interprocess_mutex *mutex() const - { return m_mut.mutex(); } + typedef ipcdetail::shm_named_mutex internal_mutex_type; #endif + internal_mutex_type &internal_mutex() + { return m_mut; } + + internal_mutex_type m_mut; - /// @endcond + #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED }; -/// @cond +#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) inline named_mutex::named_mutex(create_only_t, const char *name, const permissions &perm) : m_mut(create_only_t(), name, perm) @@ -160,9 +159,9 @@ inline bool named_mutex::timed_lock(const boost::posix_time::ptime &abs_time) { return m_mut.timed_lock(abs_time); } inline bool named_mutex::remove(const char *name) -{ return impl_t::remove(name); } +{ return internal_mutex_type::remove(name); } -/// @endcond +#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED } //namespace interprocess { } //namespace boost { |