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] Thread support for TPF


Zack Weinberg wrote:

> Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:
> 
> > + static inline int
> > + __gthread_active_p (void)
> > + {
> > +   return 1;
> > + }
> > + 
> > + static inline int
> > + __gthread_once (__gthread_once_t *once, void (*func) (void))
> > + {
> > +   if (__tpf_pthread_active ())
> > +     return pthread_once (once, func);
> > +   else
> > +     return -1;
> > + }
> 
> Why this instead of mapping __gthread_active_p to
> __tpf_pthread_active?

Because __gthread_active_p is currently understood by libstdc++
to never change during execution of a program, and mean something
like 'the current program might become multi-threaded at any 
point during future execution' (which is always true on TPF).
See e.g.

namespace __gnu_cxx
{
  namespace {
#if defined __GTHREADS
    bool const __threads_enabled = __gthread_active_p();
#endif

  }

in include/ext/bitmap_allocator.h ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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