Patchwork fix libstdc++/47354

login
register
mail settings
Submitter Jonathan Wakely
Date Jan. 19, 2011, 2:26 a.m.
Message ID <AANLkTi==Msqf9xmNC_tat2-ry7zNMtqMYpoe-4=uX1jJ@mail.gmail.com>
Download mbox | patch
Permalink /patch/79393/
State New
Headers show

Comments

Jonathan Wakely - Jan. 19, 2011, 2:26 a.m.
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.

Patch

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;