diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2011-07-04 13:29:55 +0000 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-11-14 13:57:28 +0400 |
commit | d57c457306c7673f73a04d9cfef56ed14c0d98e3 (patch) | |
tree | 0acf6a3bbe04e40beb67a1b90b6a8739469fb118 | |
parent | 17466786af4f462d95e49ef234a92429e7cd1be0 (diff) | |
download | bdwgc-d57c457306c7673f73a04d9cfef56ed14c0d98e3.tar.gz |
2011-07-04 Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)
* configure.ac (GC_THREADS): Refine the comment.
* configure.ac (GC_WIN32_PTHREADS): Add template.
* configure.ac (cygwin, win32): Define GC_WIN32_THREADS instead of
GC_THREADS.
* configure.ac (pthreads): Add mingw target (GC_WIN32_PTHREADS).
* configure: Regenerate.
* include/private/config.h.in: Ditto.
* include/private/gc_locks.h (GC_WIN32_PTHREADS): Remove nested
test for the macro; add comment.
--HG--
branch : bdwgc
-rw-r--r-- | ChangeLog | 12 | ||||
-rwxr-xr-x | configure | 24 | ||||
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | include/private/config.h.in | 7 | ||||
-rw-r--r-- | include/private/gc_locks.h | 23 |
5 files changed, 63 insertions, 27 deletions
@@ -1,3 +1,15 @@ +2011-07-04 Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo) + + * configure.ac (GC_THREADS): Refine the comment. + * configure.ac (GC_WIN32_PTHREADS): Add template. + * configure.ac (cygwin, win32): Define GC_WIN32_THREADS instead of + GC_THREADS. + * configure.ac (pthreads): Add mingw target (GC_WIN32_PTHREADS). + * configure: Regenerate. + * include/private/config.h.in: Ditto. + * include/private/gc_locks.h (GC_WIN32_PTHREADS): Remove nested + test for the macro; add comment. + 2011-07-01 Ivan Maidanski <ivmai@mail.ru> * win32_threads.c (CHECK_LOOKUP_MY_THREAD): New macro definition. @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.67 . +# From configure.ac Revision: 1.68 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for gc 7.2alpha7. # @@ -4969,6 +4969,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : @@ -5062,7 +5063,8 @@ if test "x$ac_cv_lib_pthread_pthread_self" = xyes; then : fi case "$host" in - x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*) + x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* \ + | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*) $as_echo "#define GC_LINUX_THREADS 1" >>confdefs.h $as_echo "#define _REENTRANT 1" >>confdefs.h @@ -5178,7 +5180,7 @@ $as_echo "$as_me: WARNING: \"Only on NetBSD 2.0 or later.\"" >&2;} ;; *-*-cygwin*) - $as_echo "#define GC_THREADS 1" >>confdefs.h + $as_echo "#define GC_WIN32_THREADS 1" >>confdefs.h if test "${enable_parallel_mark}" = yes; then $as_echo "#define PARALLEL_MARK 1" >>confdefs.h @@ -5191,6 +5193,18 @@ $as_echo "$as_me: WARNING: \"Only on NetBSD 2.0 or later.\"" >&2;} THREADDLLIBS="" win32_threads=true ;; + *-*-mingw*) + $as_echo "#define GC_WIN32_PTHREADS 1" >>confdefs.h + + # Using win32-pthreads + if test "${enable_parallel_mark}" = yes; then + $as_echo "#define PARALLEL_MARK 1" >>confdefs.h + + fi + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + + THREADDLLIBS="-lpthread" + ;; *-*-darwin*) $as_echo "#define GC_DARWIN_THREADS 1" >>confdefs.h @@ -5235,7 +5249,7 @@ $as_echo "$as_me: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&2;}; esac ;; win32) - $as_echo "#define GC_THREADS 1" >>confdefs.h + $as_echo "#define GC_WIN32_THREADS 1" >>confdefs.h if test "${enable_parallel_mark}" = yes; then $as_echo "#define PARALLEL_MARK 1" >>confdefs.h @@ -5252,7 +5266,7 @@ $as_echo "#define EMPTY_GETENV_RESULTS 1" >>confdefs.h THREADS=dgux386 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THREADDLLIBS" >&5 $as_echo "$THREADDLLIBS" >&6; } - # Use pthread GCC switch + # Use pthread GCC switch THREADDLLIBS=-pthread if test "${enable_parallel_mark}" = yes; then $as_echo "#define PARALLEL_MARK 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 81899cff..f66ce6bd 100644 --- a/configure.ac +++ b/configure.ac @@ -78,7 +78,8 @@ AH_TEMPLATE([USE_COMPILER_TLS], [Define to use of compiler-support for thread-local variables.]) dnl Thread selection macros. -AH_TEMPLATE([GC_THREADS], [Define to support threads.]) +AH_TEMPLATE([GC_THREADS], [Define to support platform-specific \ + threads.]) AH_TEMPLATE([GC_AIX_THREADS], [Define to support IBM AIX threads.]) AH_TEMPLATE([GC_DARWIN_THREADS], [Define to support Darwin pthreads.]) AH_TEMPLATE([GC_FREEBSD_THREADS], [Define to support FreeBSD pthreads.]) @@ -90,7 +91,8 @@ AH_TEMPLATE([GC_NETBSD_THREADS], [Define to support NetBSD pthreads.]) AH_TEMPLATE([GC_OPENBSD_THREADS], [Define to support OpenBSD pthreads.]) AH_TEMPLATE([GC_OSF1_THREADS], [Define to support Tru64 pthreads.]) AH_TEMPLATE([GC_SOLARIS_THREADS], [Define to support Solaris pthreads.]) -AH_TEMPLATE([GC_WIN32_THREADS], [Define to support win32 threads.]) +AH_TEMPLATE([GC_WIN32_THREADS], [Define to support Win32 threads.]) +AH_TEMPLATE([GC_WIN32_PTHREADS], [Define to support win32-pthreads.]) dnl System header feature requests. AH_TEMPLATE([_POSIX_C_SOURCE], [The POSIX feature macro.]) @@ -110,7 +112,8 @@ case "$THREADS" in THREADS=posix AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,) case "$host" in - x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*) + x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* \ + | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*) AC_DEFINE(GC_LINUX_THREADS) AC_DEFINE(_REENTRANT) if test "${enable_parallel_mark}" = yes; then @@ -190,7 +193,7 @@ case "$THREADS" in AC_DEFINE(GC_IRIX_THREADS) ;; *-*-cygwin*) - AC_DEFINE(GC_THREADS) + AC_DEFINE(GC_WIN32_THREADS) if test "${enable_parallel_mark}" = yes; then AC_DEFINE(PARALLEL_MARK) fi @@ -200,6 +203,15 @@ case "$THREADS" in THREADDLLIBS="" win32_threads=true ;; + *-*-mingw*) + AC_DEFINE(GC_WIN32_PTHREADS) + # Using win32-pthreads + if test "${enable_parallel_mark}" = yes; then + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + THREADDLLIBS="-lpthread" + ;; *-*-darwin*) AC_DEFINE(GC_DARWIN_THREADS) AC_DEFINE(THREAD_LOCAL_ALLOC) @@ -236,7 +248,7 @@ case "$THREADS" in esac ;; win32) - AC_DEFINE(GC_THREADS) + AC_DEFINE(GC_WIN32_THREADS) if test "${enable_parallel_mark}" = yes; then AC_DEFINE(PARALLEL_MARK) AC_DEFINE(THREAD_LOCAL_ALLOC) @@ -248,7 +260,7 @@ case "$THREADS" in dgux386) THREADS=dgux386 AC_MSG_RESULT($THREADDLLIBS) - # Use pthread GCC switch + # Use pthread GCC switch THREADDLLIBS=-pthread if test "${enable_parallel_mark}" = yes; then AC_DEFINE(PARALLEL_MARK) diff --git a/include/private/config.h.in b/include/private/config.h.in index 6af87d14..a14c0f34 100755..100644 --- a/include/private/config.h.in +++ b/include/private/config.h.in @@ -69,7 +69,7 @@ /* Define to support Solaris pthreads. */ #undef GC_SOLARIS_THREADS -/* Define to support threads. */ +/* Define to support platform-specific threads. */ #undef GC_THREADS /* See doc/README.macros. */ @@ -81,7 +81,10 @@ /* The minor version number of this GC release. */ #undef GC_VERSION_MINOR -/* Define to support win32 threads. */ +/* Define to support win32-pthreads. */ +#undef GC_WIN32_PTHREADS + +/* Define to support Win32 threads. */ #undef GC_WIN32_THREADS /* Define to 1 if you have the <dlfcn.h> header file. */ diff --git a/include/private/gc_locks.h b/include/private/gc_locks.h index b38384cf..113b4aea 100644 --- a/include/private/gc_locks.h +++ b/include/private/gc_locks.h @@ -99,20 +99,15 @@ # define THREAD_EQUAL(id1, id2) ((id1) == (id2)) # define NUMERIC_THREAD_ID_UNIQUE # else -# if defined(GC_WIN32_PTHREADS) -# define NUMERIC_THREAD_ID(id) ((unsigned long)(id.p)) - /* Using documented internal details of win32_pthread library. */ - /* Faster than pthread_equal(). Should not change with */ - /* future versions of win32_pthread library. */ -# define THREAD_EQUAL(id1, id2) ((id1.p == id2.p) && (id1.x == id2.x)) -# undef NUMERIC_THREAD_ID_UNIQUE -# else - /* Generic definitions that always work, but will result in */ - /* poor performance and weak assertion checking. */ -# define NUMERIC_THREAD_ID(id) 1l -# define THREAD_EQUAL(id1, id2) pthread_equal(id1, id2) -# undef NUMERIC_THREAD_ID_UNIQUE -# endif +# define NUMERIC_THREAD_ID(id) ((unsigned long)(id.p)) + /* Using documented internal details of win32-pthread library. */ + /* Faster than pthread_equal(). Should not change with */ + /* future versions of win32-pthread library. */ +# define THREAD_EQUAL(id1, id2) ((id1.p == id2.p) && (id1.x == id2.x)) +# undef NUMERIC_THREAD_ID_UNIQUE + /* Generic definitions based on pthread_equal() always work but */ + /* will result in poor performance (as NUMERIC_THREAD_ID is */ + /* defined to just a constant) and weak assertion checking. */ # endif # define NO_THREAD ((unsigned long)(-1l)) /* != NUMERIC_THREAD_ID(pthread_self()) for any thread */ |