This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[Patch] Further fix for 12658
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 29 Jul 2004 11:47:11 +0200
- Subject: [Patch] Further fix for 12658
Hi,
the below tweaks the current locking code as per the latest analysis
from Pétur in the audit trail.
Regtested x86/x86_64(4-way)/ia64(4-way) and checked that apparently
the only remaining failure modes are those due to the orthogonal libc
issue (now fixed in cvs by Jakub)
If nobody objects will commit soon...
Paolo.
//////////////
2004-07-29 Paolo Carlini <pcarlini@suse.de>
Petur Runolfsson <peturr02@ru.is>
PR libstdc++/12658 (continued)
* src/locale_init.cc (locale::locale, locale::global): Use
a single locale_mutex instead of two separate mutexes. diff -urN libstdc++-v3-orig/src/locale_init.cc libstdc++-v3/src/locale_init.cc
--- libstdc++-v3-orig/src/locale_init.cc 2004-06-25 08:10:44.000000000 +0200
+++ libstdc++-v3/src/locale_init.cc 2004-07-28 20:31:36.000000000 +0200
@@ -89,9 +89,8 @@
extern std::__timepunct_cache<wchar_t> timepunct_cache_w;
#endif
- // Mutex objects for locale initialization.
- __glibcxx_mutex_define_initialized(locale_cons_mutex);
- __glibcxx_mutex_define_initialized(locale_global_mutex);
+ // Mutex object for locale initialization.
+ __glibcxx_mutex_define_initialized(locale_mutex);
} // namespace __gnu_internal
namespace std
@@ -101,7 +100,7 @@
locale::locale() throw() : _M_impl(0)
{
_S_initialize();
- __gnu_cxx::lock sentry(__gnu_internal::locale_cons_mutex);
+ __gnu_cxx::lock sentry(__gnu_internal::locale_mutex);
_S_global->_M_add_reference();
_M_impl = _S_global;
}
@@ -112,7 +111,7 @@
_S_initialize();
_Impl* __old;
{
- __gnu_cxx::lock sentry(__gnu_internal::locale_global_mutex);
+ __gnu_cxx::lock sentry(__gnu_internal::locale_mutex);
__old = _S_global;
__other._M_impl->_M_add_reference();
_S_global = __other._M_impl;