locale.cc (locale::_S_initialize): Use __gthread_active_p.

2003-10-02  Benjamin Kosnik  <bkoz@redhat.com>

	* src/locale.cc (locale::_S_initialize): Use __gthread_active_p.
	(locale::facet::_S_get_c_locale): Same.

From-SVN: r72045
This commit is contained in:
Benjamin Kosnik 2003-10-02 19:02:58 +00:00 committed by Benjamin Kosnik
parent b59b508138
commit 5c109a1758
2 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2003-10-02 Benjamin Kosnik <bkoz@redhat.com>
* src/locale.cc (locale::_S_initialize): Use __gthread_active_p.
(locale::facet::_S_get_c_locale): Same.
2003-10-02 Benjamin Kosnik <bkoz@redhat.com>
* config/linker-map.gnu: Export _S_get_c_locale instead of

View File

@ -385,11 +385,14 @@ namespace std
locale::_S_initialize()
{
#ifdef __GTHREADS
if (__gthread_active_p())
__gthread_once(&_S_once, _S_initialize_once);
#else
else
#endif
{
if (!_S_classic)
_S_initialize_once();
#endif
}
}
void
@ -472,11 +475,14 @@ namespace std
locale::facet::_S_get_c_locale()
{
#ifdef __GHTREADS
if (__gthread_active_p())
__gthread_once(&_S_once, _S_initialize_once);
#else
else
#endif
{
if (!_S_c_locale)
_S_initialize_once();
#endif
}
return _S_c_locale;
}