PATCH: Allow gcc/gthr* to be compiled by C++ as well as C

Loren James Rittle rittle@latour.rsch.comm.mot.com
Tue Jun 5 08:14:00 GMT 2001


In article < m3g0dfi5hx.fsf@prospero.cambridge.redhat.com > you write:

> Shouldn't those all be void (*)(), not void *?

>>! static void *__gthread_active_ptr = (void *) &pthread_create;

I don't think so.  No function calls are ever made through
__gthread_active_ptr.  It is used only as a boolean flag in code to
determine if (e.g.) pthread_create is a weak symbol with value 0.

In other implementations of the gthr.h interface (e.g. win32),
__gthread_active_ptr might map to a symbol known to exist in the
threaded C library with value 1 and exist in the non-threaded C
library with a value 0.

Why it is type (void*) instead of int is unknown to me.

Regards,
Loren



More information about the Libstdc++ mailing list