------- 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

Reply via email to