]> granicus.if.org Git - python/commitdiff
Patch 775605: Cygwin pthread_sigmask() workaround patch
authorJason Tishler <jason@tishler.net>
Tue, 22 Jul 2003 15:20:49 +0000 (15:20 +0000)
committerJason Tishler <jason@tishler.net>
Tue, 22 Jul 2003 15:20:49 +0000 (15:20 +0000)
Cygwin's pthread_sigmask() implementation appears to be buggy. This
patch works around this problem by using sigprocmask() instead.

This patch is implemented in a general way so it could be used by other
platforms too. If this approach is deemed too risky, then I can work up
a patch that just hacks Python/thread_pthread.h for Cygwin.

Note that I tested this patch against 2.3c1 under Red Hat Linux 8.0 too.

[snip]
And finally, I need someone to regenerate pyconfig.h.in and configure
with the same versions of the autotools that are normally used by
Python.

Neal kindly regenerated pyconfig.h.in and configure for me.

Python/thread_pthread.h
configure
configure.in
pyconfig.h.in

index 2e594fe922e16a679a74f217418105fd4feb76c8..0f7ad20c2ab2d7abf631e9cd944af71bf8e6f2c0 100644 (file)
  * other UNIX International compliant systems that don't have the full
  * pthread implementation.
  */
-#ifdef HAVE_PTHREAD_SIGMASK
+#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
 #  define SET_THREAD_SIGMASK pthread_sigmask
 #else
 #  define SET_THREAD_SIGMASK sigprocmask
index a132a9e206371a518179da10c60a36c1b3f7e924..d067edd70d7fbb8e16281b3ae49b2f57cce0d8c2 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.424 .
+# From configure.in Revision: 1.425 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.53 for python 2.3.
 #
@@ -908,7 +908,7 @@ esac
 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
 # absolute.
 ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
 ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
 ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
 
@@ -11785,7 +11785,15 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ case $ac_sys_system in
+        CYGWIN*)
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BROKEN_PTHREAD_SIGMASK 1
+_ACEOF
+
+            ;;
+        esac
 fi
 done
 
@@ -18502,7 +18510,7 @@ esac
 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
 # absolute.
 ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
 ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
 ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
 
index 16a1642381ee75e0d8e4d8c3269cedba1969c665..a15a023c585bdcb0014f8abf13479ae6a9156ec3 100644 (file)
@@ -1701,7 +1701,13 @@ if test "$posix_threads" = "yes"; then
       if test "$ac_cv_pthread_system_supported" = "yes"; then
         AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.])
       fi
-      AC_CHECK_FUNCS(pthread_sigmask)
+      AC_CHECK_FUNCS(pthread_sigmask,
+        [case $ac_sys_system in
+        CYGWIN*)
+          AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
+            [Define if pthread_sigmask() does not work on your system.])
+            ;;
+        esac])
 fi
 
 
index 0a58278bc612954149d4c92ffde347d08d6c2419..dacd3042a2b664e90ed2ee979b4779a271bbc716 100644 (file)
@@ -47,6 +47,9 @@
 /* Define if the Posix semaphores do not work on your system */
 #undef HAVE_BROKEN_POSIX_SEMAPHORES
 
+/* Define if pthread_sigmask() does not work on your system. */
+#undef HAVE_BROKEN_PTHREAD_SIGMASK
+
 /* Define to 1 if you have the `chown' function. */
 #undef HAVE_CHOWN
 
 /* Define on NetBSD to activate all library features */
 #undef _NETBSD_SOURCE
 
-/* Define on FreeBSD to activate all library features */
-#undef __BSD_VISIBLE
-
 /* Define _OSF_SOURCE to get the makedev macro. */
 #undef _OSF_SOURCE
 
 /* Define to activate Unix95-and-earlier features */
 #undef _XOPEN_SOURCE_EXTENDED
 
+/* Define on FreeBSD to activate all library features */
+#undef __BSD_VISIBLE
+
 /* Define to 1 if type `char' is unsigned and you are not using gcc.  */
 #ifndef __CHAR_UNSIGNED__
 # undef __CHAR_UNSIGNED__