Commit 2b2ec3fb by Loren J. Rittle Committed by Loren J. Rittle

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
parent 5b0c5896
2001-11-26 Loren J. Rittle <ljrittle@acm.org>
* 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 <ljrittle@acm.org> 2001-10-23 Loren J. Rittle <ljrittle@acm.org>
Andreas Tobler <toa@pop.agri.ch> Andreas Tobler <toa@pop.agri.ch>
......
...@@ -1540,7 +1540,7 @@ else ...@@ -1540,7 +1540,7 @@ else
if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do for file in conftest.*; do
case $file in case $file in
*.c | *.o | *.obj) ;; *.c | *.C | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac esac
done done
...@@ -2591,7 +2591,7 @@ else ...@@ -2591,7 +2591,7 @@ else
if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do for file in conftest.*; do
case $file in case $file in
*.c | *.o | *.obj) ;; *.c | *.C | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac esac
done done
...@@ -2693,7 +2693,8 @@ EOF ...@@ -2693,7 +2693,8 @@ EOF
THREADLIBS="-lpthread -lrt" THREADLIBS="-lpthread -lrt"
;; ;;
*-*-freebsd*) *-*-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 cat >> confdefs.h <<\EOF
#define GC_FREEBSD_THREADS 1 #define GC_FREEBSD_THREADS 1
EOF EOF
...@@ -2732,7 +2733,7 @@ esac ...@@ -2732,7 +2733,7 @@ esac
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2740,7 +2741,7 @@ else ...@@ -2740,7 +2741,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2744 "configure" #line 2745 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2751,7 +2752,7 @@ int main() { ...@@ -2751,7 +2752,7 @@ int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2755: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
......
...@@ -90,7 +90,8 @@ case "$THREADS" in ...@@ -90,7 +90,8 @@ case "$THREADS" in
THREADLIBS="-lpthread -lrt" THREADLIBS="-lpthread -lrt"
;; ;;
*-*-freebsd*) *-*-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) AC_DEFINE(GC_FREEBSD_THREADS)
INCLUDES="$INCLUDES -pthread" INCLUDES="$INCLUDES -pthread"
THREADLIBS=-pthread THREADLIBS=-pthread
......
...@@ -1268,17 +1268,6 @@ int WRAP_FUNC(pthread_join)(pthread_t thread, void **retval) ...@@ -1268,17 +1268,6 @@ int WRAP_FUNC(pthread_join)(pthread_t thread, void **retval)
/* cant have been recycled by pthreads. */ /* cant have been recycled by pthreads. */
UNLOCK(); UNLOCK();
result = REAL_FUNC(pthread_join)(thread, retval); 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) { if (result == 0) {
LOCK(); LOCK();
/* Here the pthread thread id may have been recycled. */ /* Here the pthread thread id may have been recycled. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment