Commit 677e7ddc by Loren J. Rittle Committed by Loren J. Rittle

(re-open) PR libstdc++/12658

	(re-open) PR libstdc++/12658
	* src/locale_init.cc (locale::locale): Remove ill-scoped mutex.
	(locale::global): Likewise.

From-SVN: r75509
parent d8f5bd50
2004-01-07 Loren J. Rittle <ljrittle@acm.org>
(re-open) PR libstdc++/12658
* src/locale_init.cc (locale::locale): Remove ill-scoped mutex.
(locale::global): Likewise.
2004-01-07 Paolo Carlini <pcarlini@suse.de> 2004-01-07 Paolo Carlini <pcarlini@suse.de>
* testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc: * testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc:
......
...@@ -97,26 +97,20 @@ namespace std ...@@ -97,26 +97,20 @@ namespace std
locale::locale() throw() locale::locale() throw()
{ {
_S_initialize(); _S_initialize();
__glibcxx_mutex_define_initialized(lock);
__glibcxx_mutex_lock(lock);
_S_global->_M_add_reference(); _S_global->_M_add_reference();
_M_impl = _S_global; _M_impl = _S_global;
__glibcxx_mutex_unlock(lock);
} }
locale locale
locale::global(const locale& __other) locale::global(const locale& __other)
{ {
_S_initialize(); _S_initialize();
__glibcxx_mutex_define_initialized(lock);
__glibcxx_mutex_lock(lock);
_Impl* __old = _S_global; _Impl* __old = _S_global;
__other._M_impl->_M_add_reference(); __other._M_impl->_M_add_reference();
_S_global = __other._M_impl; _S_global = __other._M_impl;
if (_S_global->_M_check_same_name() if (_S_global->_M_check_same_name()
&& (std::strcmp(_S_global->_M_names[0], "*") != 0)) && (std::strcmp(_S_global->_M_names[0], "*") != 0))
setlocale(LC_ALL, __other.name().c_str()); setlocale(LC_ALL, __other.name().c_str());
__glibcxx_mutex_unlock(lock);
// Reference count sanity check: one reference removed for the // Reference count sanity check: one reference removed for the
// subsition of __other locale, one added by return-by-value. Net // subsition of __other locale, one added by return-by-value. Net
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment