This is the mail archive of the
pthreads-win32@sourceware.cygnus.com
mailing list for the pthreas-win32 project.
RE: pthread_exit bug ?
- To: 'Milan Gardian' <mg@tatramed.sk>, 'Tristan Savatier' <tristan@mpegtv.com>, pthreads-win32@sourceware.cygnus.com
- Subject: RE: pthread_exit bug ?
- From: "Bossom, John" <John.Bossom@Cognos.COM>
- Date: Thu, 2 Sep 1999 17:28:06 -0400
Yes... Unless you call pthread_exit from the main line, you will
not have any of your thread-specific-destroy routines called for the
main-line.
(I believe this is documented in one of the PThreads books by Bil Lewis)
John.
-----Original Message-----
From: Milan Gardian [mailto:mg@tatramed.sk]
Sent: Thursday, September 02, 1999 6:36 AM
To: 'Tristan Savatier'; pthreads-win32@sourceware.cygnus.com
Subject: RE: pthread_exit bug ?
[snip]
> My program creates several threads. At termination,
> each thread (except the main thread) terminates by calling
> pthread_exit, then the main thread terminates by
> calling pthread_exit (at this point, all my threads
> are terminated, therefore the process should disapear).
(This note does not try to diminish the meaning of the reported bug)
Q: Is there a reason to use pthread_exit from the main thread? A special
functionality prehaps? Specifically, I would like to know if there's some
difference between these two code snips:
(a)
int main(void)
{
//Do some threading stuff...
return (24);
}
(b)
void main(void)
{
//Do some threading stuff...
pthread_exit(24);
}
From the rather ideological reasons :) I prefer the (a) version, but will
gladly learn if there's a point in the (b) version.
Looking forward to anyone answering;
Yours sincerely,
Milan G.