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?


On 17 Jan 2002, Adam Megacz wrote:
> So the assumption that "no -mthreads == no threads" isn't always true.

True.  Most platforms have some way to explicitly request a threaded
runtime, e.g. -lpthread.  For those it's critical that they can disable
the gthr-* functionality.

But for mingw, win32 thread functions are always available with or without
-mthreads.  So you could probably make your proposed modification without
breaking anything (in a single-threaded program, freeing the TLS isn't an
issue).

> 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.

I'm not exactly objecting, but realize that this will add some overhead to
mingw programs that use EH without threads.  There ought to be a way to
declare to the compiler that you don't intend to use threads, and
ostensibly this is done now by omitting -mthreads.

Alternatively, could you somehow eliminate libmingwthrd from the link
spec?  Perhaps handle threads in the STARTFILE_SPEC instead?

Jeff


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