This is the mail archive of the
pthreads-win32@sourceware.cygnus.com
mailing list for the pthreas-win32 project.
Re: pthread_exit bug ?
- To: Tristan Savatier <tristan@mpegtv.com>
- Subject: Re: pthread_exit bug ?
- From: Ross Johnson <rpj@ise.canberra.edu.au>
- Date: Thu, 2 Sep 1999 20:21:10 +1000 (EST)
- cc: pthreads-win32@sourceware.cygnus.com
Tristan,
Please try pthreads-win32-snap-1999-08-12 with your code. It fixes a
bug in pthread_exit.
ftp://sourceware.cygnus.com/pub/pthreads-win32/dll-latest
I'm about to create a new snapshot so keep a lookout for that one
also.
Cheers.
Ross
On Thu, 2 Sep 1999, Tristan Savatier wrote:
> I am currently using pthreads-win32-snap-1999-05-30,
> using VC++ 6.0 under Win98.
>
> 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 works fine with native pthread libraries on
> Linux and other Posix systems.
>
> But I noticed that with pthreads-win32, calling pthread_exit
> to terminate my main thread does not work well: the process survives
> with two dangling threads (both threads are some type
> of internal kernel threads, not running any of my code).
>
> If I call exit(0) [instead of pthread_exit] to terminate
> my main thread, the process terminates properly (i.e.
> this is a workaround).
>
> This looks like a bug: the pthread standard says,
> in the pthread_exit specification:
> <<When the last thread in a process exits, exit(0)
> will be called.>>
>
> Is that a known bug ?
>
> -t
>
+----------------------+---+
| Ross Johnson | | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra | FAX: +61 6 2015227
| PO Box 1 |
| Belconnen ACT 2616 | WWW: http://willow.canberra.edu.au/~rpj/
| AUSTRALIA |
+--------------------------+