what does __gthread_active_p() do/mean?

Adam Megacz gcc@lists.megacz.com
Thu Jan 17 15:49:00 GMT 2002


Jeff Sturm <jsturm@one-point.com> writes:
> > I'm investigating some breakage involving mingw and sjlj-exceptions's
> > need for thread-local storage; I believe that it's returning the wrong
> > value on mingw, but I'd like to know what the meaning of the return
> > value is.

> Judging by the comments, if you compile/link without -mthreads,
> gthr-win32.h assumes your program won't use threads.  Could that be what
> is happening?

Yes, that's quite possibly what it is.

However, this isn't always a safe assumption. For various reasons, I
am willing to give up TLS garbage collection in order to not have to
distribute mingwthr.dll (or whatever it's called). This is a pretty
big deal for me.

So the assumption that "no -mthreads == no threads" isn't always true.

Would anybody object to having this always return 1 on mingw
platforms? The TlsGet() and TlsSet() functions which it enables don't
require mingwthr.dll.

  - a



More information about the Gcc mailing list