This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: pthread_exit bug ?
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 ?
Yes, I noticed this already and tried to find out possible workarounds, but
I forgot this problem later, because my application calls exit().
I'm not sure but I remember that last year's snapshots behaved correctly...