]> git.lyx.org Git - features.git/blobdiff - boost/boost/smart_ptr/detail/quick_allocator.hpp
boost: update to 1.42.0
[features.git] / boost / boost / smart_ptr / detail / quick_allocator.hpp
index 6d136f82d73f2dbb25561260ecd9d0aa6c1978c3..159bd5e7aa88e86cf8b519ac39af944a189bd5e0 100644 (file)
@@ -74,8 +74,9 @@ template<unsigned size, unsigned align_> struct allocator_impl
 
     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;