Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jun 1998 07:06:56 +1000 (EST)
From:      John Birrell  <jb@cimlogic.com.au>
To:        shmit@kublai.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Weirdness with pthreads in -current
Message-ID:  <199806242106.HAA04775@cimlogic.com.au>
In-Reply-To: <19980624031814.19037@kublai.com> from Brian Cully at "Jun 24, 98 03:18:14 am"

next in thread | previous in thread | raw e-mail | index | archive | help
[ This should have been sent to -current, not -hackers ]

Brian Cully wrote:
> If I call pthread_join(3) on a thread that's called sleep(3),
> pthread_join returns a value of `3', but errno isn't touched. If
> I remove the call to sleep inside of the thread, pthread_join works
> just fine.

POSIX says that pthread_join() returns zero if no error, otherwise an
error number is returned. It doesn't touch errno because it is not supposed
to. 8-)

Error 3 is ESRCH which is (supposed to be) returned if the thread that
you attempt to join can't be found. Since you say it is waiting, but
still returning ESRCH, my guess is that it is waiting to lock either
the thread list or the dead thread list and by the time it gets the
lock, the thread has been joined by another thread.

> This is -current from 28-May-1998, BTW.

Do you have a small test program that exhibits this problem?

-- 
John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806242106.HAA04775>