Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58275 - trunk/boost/smart_ptr/detail
From: pdimov_at_[hidden]
Date: 2009-12-10 15:34:47


Author: pdimov
Date: 2009-12-10 15:34:46 EST (Thu, 10 Dec 2009)
New Revision: 58275
URL: http://svn.boost.org/trac/boost/changeset/58275

Log:
Avoid static destruction order issues with quick_allocator.
Text files modified:
   trunk/boost/smart_ptr/detail/quick_allocator.hpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: trunk/boost/smart_ptr/detail/quick_allocator.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/quick_allocator.hpp (original)
+++ trunk/boost/smart_ptr/detail/quick_allocator.hpp 2009-12-10 15:34:46 EST (Thu, 10 Dec 2009)
@@ -74,8 +74,9 @@
 
     static lightweight_mutex & mutex()
     {
- static lightweight_mutex m;
- return m;
+ static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm;
+ static lightweight_mutex * pm = new( &fbm ) lightweight_mutex;
+ return *pm;
     }
 
     static lightweight_mutex * mutex_init;


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