This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Threadsafe locale initialization


>I copied the __gthread_active_p() check from __mt_alloc::allocate
>(in include/ext/mt_allocator.h). The implementation of
>__gthread_once in gthr-posix.h is:
>
>static inline int
>__gthread_once (__gthread_once_t *once, void (*func) (void))
>{
>  if (__gthread_active_p ())
>    return pthread_once (once, func);
>  else
>    return -1;
>} 
>
>so it seems that _S_initialize_once() must be called manually if
>__GTHREADS is defined but __gthread_active_p() returns false.
>Am I missing something obvious here?

>From gthr.h, it looks like __gthread_active_p always returns true if
__GTHREADS. Maybe I'm wrong?

Anyway.

I'd really like bits/stl_threads.h to be killed entirely, and code
including it to be changed to use bits/gthr.h. 

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]