summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-08-05 22:00:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-08-05 22:00:58 (GMT)
commit50a950f2b10879c2f606b8bed76a79b6d5f2c381 (patch)
tree56e6c4e66ddff63d098281e220a414f4d18ffc04
parent861b34625cd9a137d81f848b63c70e1f8318ba35 (diff)
parentc74640849ef38c01a98a0a1338f72bbb56668d5e (diff)
downloadtcl-50a950f2b10879c2f606b8bed76a79b6d5f2c381.zip
tcl-50a950f2b10879c2f606b8bed76a79b6d5f2c381.tar.gz
tcl-50a950f2b10879c2f606b8bed76a79b6d5f2c381.tar.bz2
Mark unixforkevent-1.1 nonPortable, until proven on more platforms.
Make sure that when testing for pthread_atfork the thread library is taken into account.
-rw-r--r--tests/unixForkEvent.test2
-rwxr-xr-xunix/configure4
-rw-r--r--unix/tcl.m44
-rw-r--r--unix/tclUnixTest.c4
4 files changed, 11 insertions, 3 deletions
diff --git a/tests/unixForkEvent.test b/tests/unixForkEvent.test
index cbe582e..120f362 100644
--- a/tests/unixForkEvent.test
+++ b/tests/unixForkEvent.test
@@ -16,7 +16,7 @@ testConstraint testfork [llength [info commands testfork]]
# Test if the notifier thread is well initialized in a forked interpreter
# by Tcl_InitNotifier
test unixforkevent-1.1 {fork and test writeable event} \
- -constraints testfork \
+ -constraints {testfork nonPortable} \
-body {
set myFolder [makeDirectory unixtestfork]
set pid [testfork]
diff --git a/unix/configure b/unix/configure
index 8779d7f..9b3c298 100755
--- a/unix/configure
+++ b/unix/configure
@@ -4821,6 +4821,9 @@ echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you m
# Does the pthread-implementation provide
# 'pthread_attr_setstacksize' ?
+ ac_saved_libs=$LIBS
+ LIBS="$LIBS $THREADS_LIBS"
+
for ac_func in pthread_attr_setstacksize pthread_atfork
do
@@ -4923,6 +4926,7 @@ _ACEOF
fi
done
+ LIBS=$ac_saved_libs
else
TCL_THREADS=0
fi
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index f12d0a8..194cf90 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -676,7 +676,11 @@ AC_DEFUN([SC_ENABLE_THREADS], [
# Does the pthread-implementation provide
# 'pthread_attr_setstacksize' ?
+
+ ac_saved_libs=$LIBS
+ LIBS="$LIBS $THREADS_LIBS"
AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
+ LIBS=$ac_saved_libs
else
TCL_THREADS=0
fi
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index f64a29e..b3e07a4 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -566,8 +566,8 @@ TestforkObjCmd(
"Cannot fork", NULL);
return TCL_ERROR;
}
-#ifndef HAVE_PTHREAD_ATFORK
- /* Only needed when pthread_atfork is not present. */
+#if !defined(HAVE_PTHREAD_ATFORK) || defined(MAC_OSX_TCL)
+ /* Only needed when pthread_atfork is not present or on OSX. */
if (pid==0) {
Tcl_InitNotifier();
}