2004-10-06 Benjamin Kosnik Paolo Carlini PR libstdc++/17780 * src/mt_allocator.cc (__pool::_M_reserve_block): Revert locking changes. Index: src/mt_allocator.cc =================================================================== RCS file: /cvs/gcc/gcc/libstdc++-v3/src/mt_allocator.cc,v retrieving revision 1.2 diff -c -p -r1.2 mt_allocator.cc *** src/mt_allocator.cc 6 Oct 2004 04:22:41 -0000 1.2 --- src/mt_allocator.cc 6 Oct 2004 15:53:44 -0000 *************** namespace __gnu_cxx *** 298,307 **** --- 298,310 ---- _Block_record* __block = NULL; if (__gthread_active_p()) { + __gthread_mutex_lock(__bin._M_mutex); if (__bin._M_first[0] == NULL) { // No need to hold the lock when we are adding a whole // chunk to our own list. + __gthread_mutex_unlock(__bin._M_mutex); + void* __v = ::operator new(__options._M_chunk_size); __bin._M_first[__thread_id] = static_cast<_Block_record*>(__v); __bin._M_free[__thread_id] = __block_count; *************** namespace __gnu_cxx *** 327,333 **** // Is the number of required blocks greater than or equal // to the number that can be provided by the global free // list? - __gthread_mutex_lock(__bin._M_mutex); __bin._M_first[__thread_id] = __bin._M_first[0]; if (__block_count >= __bin._M_free[0]) { --- 330,335 ----