[x264-devel] Re: x264: svn commit r250 (titer)

Gianluigi Tiesi mplayer at netfarm.it
Mon Jun 6 16:31:01 CEST 2005


On Mon, Jun 06, 2005 at 09:29:52AM +0100, Gildas Bazin wrote:
> On Monday 06 June 2005 08:12, Gianluigi Tiesi wrote:
> > On Sun, Jun 05, 2005 at 12:17:10PM +0200, Subversion daemon wrote:
> > > r250 | titer | 2005-06-05 12:17:10 +0200 (Sun, 05 Jun 2005) | 3 lines
> > > Changed paths:
> > >    M /trunk/configure
> > >    M /trunk/encoder/encoder.c
> > > 
> > >  Use win32 native threads (you still have to --enable-pthread to use
> > >  them, though)
> > > 
> > > -- 
> > Milan Cutka (the author of ffdshow, pointed me to the fact that
> > is not a good idea to call CloseHandle over a terminated thread,
> > so it would be safe to do not call it.
> > 
> 
> It is perfectly safe as long as it is the joining thread that closes the 
> handle, and not doing so will create a leak of handles which will 
> eventually lead to the application not being able to spawn anymore threads, 
> etc...
I agree I've added it because I was looking at the process with
processxp and a lot of handles were not closed, but I quote Milan's message:

>I'm getting a lot of exceptions about invalid handle thrown when x264 calls
>CloseHandle after WaitForSingleObject. I guess it's because the thread doesn't
>exists anymore after WaitForSingleObject returns. When I commented
>CloseHandle, the threads are destroyed and no exceptions are thrown.

It's very strange anyway that this will causes exceptions, I've seen
some example of create/wait thread on internet and most examples
are not calling CloseHandle, but the correct use is to call CloseThread
after WaitForSingleObject.

Bye

-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list