This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: what does __gthread_active_p() do/mean?



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


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