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


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