This is the mail archive of the gcc-patches@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]

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


So just focusing on posix platform in these patches.

gthr-posix-patch.txt includes the necessary changes to gthr-posix.h
and gthr-posix.c. I moved some of the objc-only definitions so they
are no longer objc-only (to avoid dup defs). The objc folk will have
to take a look at this to make sure its ok
(--enable-languages=c,c++,objc on x86_64 bootstraps fine for what its
worth).

The second patch is the libstdc++-v3 configury bits that basically
tests for the required __gthread*_t types and functions using
AC_TRY_LINK. This was slightly difficult because gthr-default hasn't
been set up yet so I had to add -D_PTHREADS to CXXFLAGS (conditionally
on posix thread model) so that gthr.h picks gthr-posix.h and I also
had to add -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK so that it linked (not
100% sure why however). I thought adding -pthreads to CXXFLAGS or
LDFLAGS would pull in the posix library for linking (if available) but
it didn't work.

If AC_TRY_LINK succeeds, _GLIBCXX_HAS_GTHREADS is defined and the
C++0x headers (<thread>, <mutex> and <condition_variable>) can use it
to conditionally provide support for the thread library (similar to
_GLIBCXX_USE_C99_STDINT_TR1)

Chris

Attachment: gthr-posix-patch.txt
Description: Text document

Attachment: gthr-v3-configury-bits.txt
Description: Text document


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