Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2007 17:45:51 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        youshi10@u.washington.edu
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Trying to join an already exited pthread
Message-ID:  <Pine.GSO.4.64.0702071740440.27627@sea.ntplx.net>
In-Reply-To: <Pine.LNX.4.43.0702071437050.22034@hymn08.u.washington.edu>
References:  <Pine.LNX.4.43.0702071437050.22034@hymn08.u.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <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



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