From c891b860da6589c40b7040252e9ffd3302b15ef4 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 29 Jul 2004 15:54:50 +0000 Subject: [PATCH] PR libstdc++/12658 (continued) 2004-07-29 Paolo Carlini Petur Runolfsson PR libstdc++/12658 (continued) * src/locale_init.cc (locale::locale, locale::global): Use a single locale_mutex instead of two separate mutexes. Co-Authored-By: Petur Runolfsson From-SVN: r85301 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/src/locale_init.cc | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8e46102abb5..12a415fe92e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2004-07-29 Paolo Carlini + Petur Runolfsson + + PR libstdc++/12658 (continued) + * src/locale_init.cc (locale::locale, locale::global): Use + a single locale_mutex instead of two separate mutexes. + 2004-07-29 Paolo Carlini PR libstdc++/16813 diff --git a/libstdc++-v3/src/locale_init.cc b/libstdc++-v3/src/locale_init.cc index 35dc3611a4b..fafe03af7ab 100644 --- a/libstdc++-v3/src/locale_init.cc +++ b/libstdc++-v3/src/locale_init.cc @@ -89,9 +89,8 @@ namespace __gnu_internal extern std::__timepunct_cache 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 @@ namespace std 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 @@ namespace std _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; -- 2.30.2