Heads up: Several thousand g++ and libstdc++ test failures on sparc[64]

Pétur Runólfsson peturr02@ru.is
Tue Oct 14 08:03:00 GMT 2003


Loren James Rittle wrote:
> Not a Solaris bug; correction of a minor confusion of the use of the
> gthr API.  At the time the code was written, it was not known by the
> author(s), that some environments might find the macro defined to 1,
> yet the dynamic check returned 0...

That problem was fixed a long time ago. The current problem is that
__GHTREADS is defined as 1, __gthread_active_p() returns 1, but
__gthread_once() fails anyway. The documentation in gthr.h for
__gthread_active_p() is:

   Also it has define function
     int __gthread_active_p ()
   that returns 1 if thread system is active, 0 if not.

__gthread_active_p() on Solaris doesn't meet this requirement, so
either __gthread_active_p() is wrong or the documentation is wrong.

> A better fix might (a) update the gthr-single.h file to make it work
> like all other implementations thus removing the need to check the
> macro in this case and (b) update the other gthr-*.h files such that
> the __gthread_once API did the right thing internally w.r.t. the
> dynamic check; thus removing the need for multiple paths in the
> caller.  However, changing the gthr ABI/API is a lot more complex...

That would indeed make it a lot easier to use.

Regards,
Petur



More information about the Libstdc++ mailing list