[PATCH] posix gthreads additions for c++0x thread library

Mark Mitchell mark@codesourcery.com
Thu Aug 28 16:52:00 GMT 2008


Chris Fairles wrote:

> Attached updated patch with changelog for v3 configuration. Bootstrapped x86_64. 

2008-07-30  Chris Fairles <chris.fairles@gmail.com>

        * acinclude.m4 (GLIBCXX_CHECK_GTHREADS): New. Checks for gthread
	support used by c++0x thread library.
	* configure.ac: Test uncondtionally.
	* configure: Regenerate.
	* config.h.in: Regenerate.

Paolo asked me to comment on this patch.  FWIW, I think this is an OK
approach, but I have a couple of suggestions:

1. Can we actually compile a small file like:

   #include <gthr.h>
   #ifndef __GTHREADS_CXX0X
   #error
   #endif

Instead of using "grep"?  That's a more "logical" approach to the check,
and it allows for things like the exact flags passed to the compiler
having a possible impact on the set of thread primitives available.  And
it avaoids a false positive on:

   /* Don't define __GTHREADS_CXX0X because we don't have ... */

2. Do we have any internals documentation for gthr.h?  If so, it should
be modified to mention that if you provide implementations of X, Y, ...
you should define the variable.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list