summaryrefslogtreecommitdiff
path: root/boehm-gc/linux_threads.c
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-12 04:37:57 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-12 04:37:57 +0000
commit0cc01484c3f8c9ec4fec760501aec318bc199adf (patch)
treecef3197531d988920cbff060bdc10742baf06d01 /boehm-gc/linux_threads.c
parentb6c37935d39c0aadd3d6eefb9e09c455c6cbd0a5 (diff)
downloadgcc-0cc01484c3f8c9ec4fec760501aec318bc199adf.tar.gz
Imported GC 6.1 Alpha 3. Finally.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49698 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/linux_threads.c')
-rw-r--r--boehm-gc/linux_threads.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/boehm-gc/linux_threads.c b/boehm-gc/linux_threads.c
index c4a2b89a18d..b26988cef9e 100644
--- a/boehm-gc/linux_threads.c
+++ b/boehm-gc/linux_threads.c
@@ -1268,6 +1268,17 @@ 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. */