(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
This commit is contained in:
Loren J. Rittle 2004-01-07 17:40:45 +00:00 committed by Loren J. Rittle
parent d8f5bd5016
commit 677e7ddcee
2 changed files with 6 additions and 6 deletions

View File

@ -1,3 +1,9 @@
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>
* testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc:

View File

@ -97,26 +97,20 @@ namespace std
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