1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#! /bin/sh -e
# DP: Patch for building on the Hurd
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
fi
case "$1" in
-patch)
patch $pdir -l -f --no-backup-if-mismatch -p0 < $0
autoconf
;;
-unpatch)
patch $pdir -l -f --no-backup-if-mismatch -R -p0 < $0
rm configure
;;
*)
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
esac
exit 0
# append the patch here and adjust the -p? flag in the patch calls.
--- Python/thread_cthread.old.h Wed Oct 31 22:50:27 2001
+++ Python/thread_cthread.h Sat Nov 3 09:23:29 2001
@@ -1,6 +1,11 @@
+#ifdef MACH_C_THREADS
#include <mach/cthreads.h>
+#endif
+#ifdef HURD_C_THREADS
+#include <cthreads.h>
+#endif
/*
* Initialization.
@@ -8,7 +13,14 @@
static void
PyThread__init_thread(void)
{
- cthread_init();
+#ifndef HURD_C_THREADS
+ /* Roland McGrath said this should not be used since this is
+ done while linking to threads */
+ cthread_init();
+#else
+/* do nothing */
+ ;
+#endif
}
/*
@@ -127,10 +139,10 @@
dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
if (waitflag) { /* blocking */
- mutex_lock(lock);
+ mutex_lock((mutex_t)lock);
success = TRUE;
} else { /* non blocking */
- success = mutex_try_lock(lock);
+ success = mutex_try_lock((mutex_t)lock);
}
dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
return success;
|