From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17198 invoked by alias); 10 May 2009 12:14:49 -0000 Received: (qmail 17146 invoked by uid 48); 10 May 2009 12:14:39 -0000 Date: Sun, 10 May 2009 12:14:00 -0000 Message-ID: <20090510121439.17145.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/40088] Creating a std::ostringstream object locks a global mutex In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg00823.txt.bz2 ------- Comment #6 from rguenth at gcc dot gnu dot org 2009-05-10 12:14 ------- Thus, I was meaning to say that Index: src/locale_init.cc =================================================================== --- src/locale_init.cc (revision 147329) +++ src/locale_init.cc (working copy) @@ -208,9 +208,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) locale::locale() throw() : _M_impl(0) { _S_initialize(); - __gnu_cxx::__scoped_lock sentry(get_locale_mutex()); - _S_global->_M_add_reference(); _M_impl = _S_global; + _M_impl->_M_add_reference(); } locale looks safe apart on architectures where the pointer read can ever return partially updated values (none I know has this problem). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40088