fix libstdc++/47354

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jan 19 05:25:00 GMT 2011


2011-01-19  Graham Reed  <greed@pobox.com>

        PR libstdc++/47354
        * src/bitmap_allocator.cc (free_list::_M_get): Lock mutex.

tested x86_64-linux, committed to trunk

As a regression against 4.1 with a safe and obvious fix I plan to also
fix it on the 4.3, 4.4 and 4.5 branches.
-------------- next part --------------
Index: src/bitmap_allocator.cc
===================================================================
--- src/bitmap_allocator.cc	(revision 168845)
+++ src/bitmap_allocator.cc	(working copy)
@@ -49,6 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
   {
 #if defined __GTHREADS
     __mutex_type& __bfl_mutex = _M_get_mutex();
+    __bfl_mutex.lock();
 #endif
     const vector_type& __free_list = _M_get_free_list();
     using __gnu_cxx::__detail::__lower_bound;


More information about the Gcc-patches mailing list