|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82796 - trunk/boost/interprocess/sync/shm
From: igaztanaga_at_[hidden]
Date: 2013-02-09 12:45:10
Author: igaztanaga
Date: 2013-02-09 12:45:09 EST (Sat, 09 Feb 2013)
New Revision: 82796
URL: http://svn.boost.org/trac/boost/changeset/82796
Log:
Fixes #7682
Text files modified:
trunk/boost/interprocess/sync/shm/named_condition.hpp | 57 +++++----------------------------------
1 files changed, 8 insertions(+), 49 deletions(-)
Modified: trunk/boost/interprocess/sync/shm/named_condition.hpp
==============================================================================
--- trunk/boost/interprocess/sync/shm/named_condition.hpp (original)
+++ trunk/boost/interprocess/sync/shm/named_condition.hpp 2013-02-09 12:45:09 EST (Sat, 09 Feb 2013)
@@ -145,7 +145,8 @@
typedef interprocess_condition internal_condition;
#endif //defined (BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
- internal_condition m_cond;
+ internal_condition &internal_cond()
+ { return *static_cast<internal_condition*>(m_shmem.get_user_address()); }
friend class boost::interprocess::ipcdetail::interprocess_tester;
void dont_close_on_destruction();
@@ -196,71 +197,29 @@
inline void shm_named_condition::dont_close_on_destruction()
{ interprocess_tester::dont_close_on_destruction(m_shmem); }
-#if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
-
inline void shm_named_condition::notify_one()
-{ m_cond.notify_one(); }
+{ this->internal_cond().notify_one(); }
inline void shm_named_condition::notify_all()
-{ m_cond.notify_all(); }
+{ this->internal_cond().notify_all(); }
template <typename L>
inline void shm_named_condition::wait(L& lock)
-{ m_cond.wait(lock); }
+{ this->internal_cond().wait(lock); }
template <typename L, typename Pr>
inline void shm_named_condition::wait(L& lock, Pr pred)
-{ m_cond.wait(lock, pred); }
+{ this->internal_cond().wait(lock, pred); }
template <typename L>
inline bool shm_named_condition::timed_wait
(L& lock, const boost::posix_time::ptime &abs_time)
-{ return m_cond.timed_wait(lock, abs_time); }
+{ return this->internal_cond().timed_wait(lock, abs_time); }
template <typename L, typename Pr>
inline bool shm_named_condition::timed_wait
(L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
-{ return m_cond.timed_wait(lock, abs_time, pred); }
-
-#else
-
-inline void shm_named_condition::notify_one()
-{ m_cond.notify_one(); }
-
-inline void shm_named_condition::notify_all()
-{ m_cond.notify_all(); }
-
-template <typename L>
-inline void shm_named_condition::wait(L& lock)
-{
- internal_mutex_lock<L> internal_lock(lock);
- m_cond.wait(internal_lock);
-}
-
-template <typename L, typename Pr>
-inline void shm_named_condition::wait(L& lock, Pr pred)
-{
- internal_mutex_lock<L> internal_lock(lock);
- m_cond.wait(internal_lock, pred);
-}
-
-template <typename L>
-inline bool shm_named_condition::timed_wait
- (L& lock, const boost::posix_time::ptime &abs_time)
-{
- internal_mutex_lock<L> internal_lock(lock);
- return m_cond.timed_wait(internal_lock, abs_time);
-}
-
-template <typename L, typename Pr>
-inline bool shm_named_condition::timed_wait
- (L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
-{
- internal_mutex_lock<L> internal_lock(lock);
- return m_cond.timed_wait(internal_lock, abs_time, pred);
-}
-
-#endif
+{ return this->internal_cond().timed_wait(lock, abs_time, pred); }
inline bool shm_named_condition::remove(const char *name)
{ return shared_memory_object::remove(name); }
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk