]> granicus.if.org Git - gc/commitdiff
2011-07-04 Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)
authorivmai <ivmai>
Mon, 4 Jul 2011 13:29:55 +0000 (13:29 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:07:00 +0000 (21:07 +0400)
* 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.

ChangeLog
configure
configure.ac
include/private/config.h.in
include/private/gc_locks.h

index c85fb3b01a8128534d5d235559bcb3b26ea58eab..d0c9bab8a99bb3a6b70fb7f16ab3beafa477348f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 102c4e934cd0b74d0a13f8e5116c46f64994d122..486a8e719179bf80419b818fbc5bc9846ba0c5c1 100755 (executable)
--- a/configure
+++ b/configure
@@ -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.
 #
@@ -4967,6 +4967,7 @@ fi
 
 
 
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
@@ -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
index 567926b2bfd59394a85e51bb8efade20e4fe7f09..f25d0216dd4b862ef3a8176670e2600b2caa1b44 100644 (file)
@@ -23,7 +23,7 @@ AC_CONFIG_SRCDIR(gcj_mlc.c)
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_TARGET
 AC_PREREQ(2.64)
-AC_REVISION($Revision: 1.68 $)
+AC_REVISION($Revision: 1.69 $)
 GC_SET_VERSION
 AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc])
 AM_CONFIG_HEADER([include/private/config.h])
@@ -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)
index 6af87d14e0ef2b2e382733a939d1005cb288bb51..a14c0f3451dfee93d58b19c2a54e3e73cfa90a4b 100644 (file)
@@ -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. */
 /* 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. */
index b38384cf76ca811f00e664b1c108a003bb77c5f6..113b4aeae5aad1689532e82d16c117d69fc4dbc7 100644 (file)
 #      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 */