The changes in r11-5314 are broken, because it means we don't use
__gthread_once for the first few initializations, but after the program
becomes multi-threaded we will repeat the initialization, using
__gthread_once once this time. This leads to memory errors.
The use of __is_single_threaded() in locale::id::_M_id() is OK, because
the side effects are the same either way.
libstdc++-v3/ChangeLog:
* src/c++98/locale.cc (locale::facet::_S_get_c_locale()):
Revert change to use __is_single_threaded.
* src/c++98/locale_init.cc (locale::_S_initialize()):
Likewise.
locale::facet::_S_get_c_locale()
{
#ifdef __GTHREADS
- if (!__gnu_cxx::__is_single_threaded())
+ if (__gthread_active_p())
__gthread_once(&_S_once, _S_initialize_once);
else
#endif
locale::_S_initialize()
{
#ifdef __GTHREADS
- if (!__gnu_cxx::__is_single_threaded())
+ if (__gthread_active_p())
__gthread_once(&_S_once, _S_initialize_once);
#endif
if (!_S_classic)