This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: libstdc++-v3/src/locale_init.cc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]