From owner-freebsd-hackers Wed Jun 24 13:58:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA27229 for freebsd-hackers-outgoing; Wed, 24 Jun 1998 13:58:53 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA27121 for ; Wed, 24 Jun 1998 13:58:25 -0700 (PDT) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.8.8/8.8.7) id HAA04775; Thu, 25 Jun 1998 07:06:56 +1000 (EST) (envelope-from jb) From: John Birrell Message-Id: <199806242106.HAA04775@cimlogic.com.au> Subject: Re: Weirdness with pthreads in -current In-Reply-To: <19980624031814.19037@kublai.com> from Brian Cully at "Jun 24, 98 03:18:14 am" To: shmit@kublai.com Date: Thu, 25 Jun 1998 07:06:56 +1000 (EST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [ 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