This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: what does __gthread_active_p() do/mean?
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Adam Megacz <gcc at lists dot megacz dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 14 Jan 2002 23:12:28 -0500 (EST)
- Subject: Re: what does __gthread_active_p() do/mean?
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