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
This commit is contained in:
Loren J. Rittle 2001-11-26 17:40:34 +00:00 committed by Loren J. Rittle
parent 5b0c589655
commit 2b2ec3fbff
4 changed files with 16 additions and 18 deletions

View File

@ -1,3 +1,10 @@
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>
Andreas Tobler <toa@pop.agri.ch>

13
boehm-gc/configure vendored
View File

@ -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 <<EOF
#line 2744 "configure"
#line 2745 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2751,7 +2752,7 @@ int main() {
dlopen()
; return 0; }
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*
eval "ac_cv_lib_$ac_lib_var=yes"
else

View File

@ -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

View File

@ -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. */