what does __gthread_active_p() do/mean?
Jeff Sturm
jsturm@one-point.com
Tue Jan 15 03:41:00 GMT 2002
On 14 Jan 2002, Adam Megacz wrote:
> What is this function supposed to do? (gthr-*.h)
>From gthr.h:
/* If this file is compiled with threads support, it must
#define __GTHREADS 1
to indicate that threads support is present. Also it has define
function
int __gthread_active_p ()
that returns 1 if thread system is active, 0 if not.
Depending on how a program is linked, thread functions may or may not be
available. Calling __gthread_active_p() will tell.
> 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?
Jeff
More information about the Gcc
mailing list