Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71495 - sandbox/mm_ptr/boost
From: phil_at_[hidden]
Date: 2011-04-25 18:23:03


Author: pbouchard
Date: 2011-04-25 18:23:03 EDT (Mon, 25 Apr 2011)
New Revision: 71495
URL: http://svn.boost.org/trac/boost/changeset/71495

Log:
* Multithread support fix
Text files modified:
   sandbox/mm_ptr/boost/mm_ptr.hpp | 11 +++++++----
   1 files changed, 7 insertions(+), 4 deletions(-)

Modified: sandbox/mm_ptr/boost/mm_ptr.hpp
==============================================================================
--- sandbox/mm_ptr/boost/mm_ptr.hpp (original)
+++ sandbox/mm_ptr/boost/mm_ptr.hpp 2011-04-25 18:23:03 EDT (Mon, 25 Apr 2011)
@@ -70,13 +70,12 @@
     intrusive_list includes_; /**< List of all sets of an union. */
     intrusive_list elements_; /**< List of all pointee objects belonging to a @c mm_header . */
 
-#ifndef BOOST_DISABLE_THREADS
- mutex mutex_;
-#endif
-
     static fast_pool_allocator<mm_header> pool_; /**< Pool where all sets are allocated. */
 
 public:
+#ifndef BOOST_DISABLE_THREADS
+ mutex mutex_;
+#endif
         bool destroy_; /**< Destruction sequence initiated. */
     intrusive_list::node tag_; /**< Tag used to enlist to @c mm_header::includes_ . */
 
@@ -412,6 +411,10 @@
         {
             if (p->init_)
                 return;
+
+#ifndef BOOST_DISABLE_THREADS
+ mutex::scoped_lock scoped_lock(ps_->mutex_);
+#endif
         
                         // iterate memory blocks
             for (intrusive_list::iterator<mm_base, & mm_base::init_tag_> i = p->inits_.begin(); i != p->inits_.end(); ++ i)


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