http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60645
Bug ID: 60645
Summary: locale::facet::_S_get_c_locale does not handle
__gthread_once error codes.
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: chris at contemporary dot net.au
RTEMS cannot use the posix thread model because the pthread_once call may
return an error code. The code libgcc/gthr-posix.h#696 returns an error yet
libstdc++-v3/src/c++98/locale.cc#209 does not check and handle the returned
error code.
The POSIX reference is:
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_once.html
The code in question is ...
204 __c_locale
205 locale::facet::_S_get_c_locale()
206 {
207 #ifdef __GTHREADS
208 if (__gthread_active_p())
209 __gthread_once(&_S_once, _S_initialize_once);
210 else
211 #endif
212 {
213 if (!_S_c_locale)
214 _S_initialize_once();
215 }
216 return _S_c_locale;
217 }
and ..
695 static inline int
696 __gthread_once (__gthread_once_t *__once, void (*__func) (void))
697 {
698 if (__gthread_active_p ())
699 return __gthrw_(pthread_once) (__once, __func);
700 else
701 return -1;
702 }