From 2b2ec3fbff90bba7e510ef6013e9c99ec24ff2cf Mon Sep 17 00:00:00 2001 From: "Loren J. Rittle" Date: Mon, 26 Nov 2001 17:40:34 +0000 Subject: [PATCH] linux_threads.c (WRAP_FUNC(pthread_join)): Remove special case for GC_FREEBSD_THREADS. * linux_threads.c (WRAP_FUNC(pthread_join)): Remove special case for GC_FREEBSD_THREADS. * configure.in (*-*-freebsd*): Clarify warning. * configure: Rebuilt. From-SVN: r47347 --- boehm-gc/ChangeLog | 7 +++++++ boehm-gc/configure | 13 +++++++------ boehm-gc/configure.in | 3 ++- boehm-gc/linux_threads.c | 11 ----------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index aefe87f..234d9df 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2001-11-26 Loren J. Rittle + + * linux_threads.c (WRAP_FUNC(pthread_join)): Remove special + case for GC_FREEBSD_THREADS. + * configure.in (*-*-freebsd*): Clarify warning. + * configure: Rebuilt. + 2001-10-23 Loren J. Rittle Andreas Tobler diff --git a/boehm-gc/configure b/boehm-gc/configure index 6a82392..a9257f3 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -1540,7 +1540,7 @@ else if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.C | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2591,7 +2591,7 @@ else if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.C | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2693,7 +2693,8 @@ EOF THREADLIBS="-lpthread -lrt" ;; *-*-freebsd*) - echo "configure: warning: "FreeBSD does not yet fully support threads with Boehm GC."" 1>&2 + echo "configure: warning: "Threaded GC is prone to deadlock before FreeBSD 4.5."" 1>&2 + echo "configure: warning: "Related symptom is pthread_join returns spurious EINTR."" 1>&2 cat >> confdefs.h <<\EOF #define GC_FREEBSD_THREADS 1 EOF @@ -2732,7 +2733,7 @@ esac echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2736: checking for dlopen in -ldl" >&5 +echo "configure:2737: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2740,7 +2741,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in index ce6b725..219af7f 100644 --- a/boehm-gc/configure.in +++ b/boehm-gc/configure.in @@ -90,7 +90,8 @@ case "$THREADS" in THREADLIBS="-lpthread -lrt" ;; *-*-freebsd*) - AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.") + AC_MSG_WARN("Threaded GC is prone to deadlock before FreeBSD 4.5.") + AC_MSG_WARN("Related symptom is pthread_join returns spurious EINTR.") AC_DEFINE(GC_FREEBSD_THREADS) INCLUDES="$INCLUDES -pthread" THREADLIBS=-pthread diff --git a/boehm-gc/linux_threads.c b/boehm-gc/linux_threads.c index b26988c..c4a2b89 100644 --- a/boehm-gc/linux_threads.c +++ b/boehm-gc/linux_threads.c @@ -1268,17 +1268,6 @@ int WRAP_FUNC(pthread_join)(pthread_t thread, void **retval) /* cant have been recycled by pthreads. */ UNLOCK(); result = REAL_FUNC(pthread_join)(thread, retval); -# if defined (GC_FREEBSD_THREADS) - /* On FreeBSD, the wrapped pthread_join() sometimes returns (what - appears to be) a spurious EINTR which caused the test and real code - to gratuitously fail. Having looked at system pthread library source - code, I see how this return code may be generated. In one path of - code, pthread_join() just returns the errno setting of the thread - being joined. This does not match the POSIX specification or the - local man pages thus I have taken the liberty to catch this one - spurious return value properly conditionalized on GC_FREEBSD_THREADS. */ - if (result == EINTR) result = 0; -# endif if (result == 0) { LOCK(); /* Here the pthread thread id may have been recycled. */ -- 2.7.4