This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: pthreads comments and suggestions [was: Re: Handle leak ?]
- To: Paul Redondo <paul at matchvision dot com>
- Subject: Re: pthreads comments and suggestions [was: Re: Handle leak ?]
- From: Ross Johnson <rpj at ise dot canberra dot edu dot au>
- Date: Mon, 24 Jul 2000 17:49:57 +1000
- CC: pthreads-win32 at sourceware dot cygnus dot com
- Organization: University of Canberra, Information Sciences and Engineering
- References: <NDBBLGLOJKFALGLAHFKAOEOGDNAA.email@example.com>
Paul Redondo wrote:
> > I got this same reaction when I notified this list about the bug
> > before: nobody believed there was a bug. TRY IT.
> I do confirm. There IS a bug. I'm gonna try your fix (the null testing), and
> relaunch the whole test (creation of detached threads during 24 hours).
David Baggett is currently testing another patch, this time in
The theory is that _beginthreadex() should start threads suspended
so that the HANDLE it returns can be assigned to thread-threadH
before the thread gets too far or ends (if it's a very short thread).
Seems obvious now, but ...
That is, the patch below:
thread->threadH = (HANDLE)
(void *) NULL, /* No security info */
(unsigned) stackSize, /* default stack size */
(unsigned (PT_STDCALL *) (void *))
(unsigned *) &(thread->thread));
if (thread->threadH != (HANDLE) 0 && run)
| Ross Johnson | | E-Mail: firstname.lastname@example.org
| 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 |