From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 7 22:45:52 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3CDA16A407 for ; Wed, 7 Feb 2007 22:45:52 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7645413C4D5 for ; Wed, 7 Feb 2007 22:45:52 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.8/8.13.8/NETPLEX) with ESMTP id l17Mjp9f025307; Wed, 7 Feb 2007 17:45:51 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-3.0 (mail.ntplx.net [204.213.176.10]); Wed, 07 Feb 2007 17:45:51 -0500 (EST) Date: Wed, 7 Feb 2007 17:45:51 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: youshi10@u.washington.edu In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Trying to join an already exited pthread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 22:45:53 -0000 On Wed, 7 Feb 2007, youshi10@u.washington.edu wrote: > On Wed, 7 Feb 2007, Pietro Cerutti wrote: > >> On 2/7/07, youshi10@u.washington.edu wrote: >>> Just wondering: >>> >>> If I was to try and join a pthread that already exited, would there be an >>> error message output and/or errno set to an error value, or would a system >>> hang? >> >> man pthread_join(3): >> >> ERRORS >> The pthread_join() function will fail if: >> [EINVAL] The implementation has detected that the value speci- >> fied by thread does not refer to a joinable thread. >> >> A pthread that already exited is considered non-joinable That is not true. A thread is joinable if it has not yet detached. A thread can exit without detaching. See the POSIX spec at http://www.opengroup.org/onlinepubs/009695399/toc.htm for more info. -- DE