This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH: libstdc++-v3/src/locale_init.cc
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 7 Jan 2004 11:40:58 -0600 (CST)
- Subject: PATCH: libstdc++-v3/src/locale_init.cc
- Reply-to: rittle at labs dot mot dot com
As applied (QoI regression from 3.X). bits/concurrence.h still needs
a minor rethink (but might be OK for some users).
(re-open) PR libstdc++/12658
* src/locale_init.cc (locale::locale): Remove ill-scoped mutex.
(locale::global): Likewise.
Index: libstdc++-v3/src/locale_init.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale_init.cc,v
retrieving revision 1.5
diff -c -r1.5 locale_init.cc
*** libstdc++-v3/src/locale_init.cc 15 Dec 2003 21:08:03 -0000 1.5
--- libstdc++-v3/src/locale_init.cc 7 Jan 2004 16:25:41 -0000
***************
*** 97,122 ****
locale::locale() throw()
{
_S_initialize();
- __glibcxx_mutex_define_initialized(lock);
- __glibcxx_mutex_lock(lock);
_S_global->_M_add_reference();
_M_impl = _S_global;
- __glibcxx_mutex_unlock(lock);
}
locale
locale::global(const locale& __other)
{
_S_initialize();
- __glibcxx_mutex_define_initialized(lock);
- __glibcxx_mutex_lock(lock);
_Impl* __old = _S_global;
__other._M_impl->_M_add_reference();
_S_global = __other._M_impl;
if (_S_global->_M_check_same_name()
&& (std::strcmp(_S_global->_M_names[0], "*") != 0))
setlocale(LC_ALL, __other.name().c_str());
- __glibcxx_mutex_unlock(lock);
// Reference count sanity check: one reference removed for the
// subsition of __other locale, one added by return-by-value. Net
--- 97,116 ----