bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGSEGV on recursive pthread_join


From: Richard Guenther
Subject: Re: SIGSEGV on recursive pthread_join
Date: Thu, 8 Jan 2004 15:01:46 +0100 (CET)

On Thu, 8 Jan 2004, Jeroen Dekkers wrote:

> On Thu, Jan 08, 2004 at 02:30:45PM +0100, Richard Guenther wrote:
> > Oh, my "current" manpage for pthread_join says:
> >
> >  "At most one thread can wait for the termination  of  a  given  thread.
> >   Calling pthread_join on a thread th on which another thread is already
> >   waiting for termination returns an error."
> >
> > which does not say anything about undefined behavior, so, if glibc is the
> > source for this manpage, one should make sure the current version is
> > up-to-date with the current behavior.
>
> Glibc isn't the source of any manpage, the glibc documentation are
> the info pages (also available in other formats like html and ps if
> you prefer that). I never use manpages because they are often
> outdated or just otherwise incorrect.
>
> > Also, SUS says
> >
> >  "The results of multiple simultaneous calls to pthread_join() specifying
> >   the same target thread are undefined."
> >  [http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_join.html]
> >
> > which talks about simultaneous pthread_join(), not about a join to a
> > previously joined thread to which the errors EINVAL or ESRCH would be
> > appropriate.
>
> If you join a thread it waits until the thread is finished, so a
> second call for the same thread is always simultaneous.

Just to clarify, I was actually doing something like:

pthread_join(thread);
...
pthread_join(thread);

so, this is clearly not "simultaneous".

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]