[vlc-devel] [PATCH] HLS: don't signal dl thread out of the blue in Close()
Jean-Baptiste Kempf
jb at videolan.org
Wed Jun 27 20:55:15 CEST 2012
On Wed, Jun 27, 2012 at 04:11:41PM +0300, Rémi Denis-Courmont wrote :
> Le lundi 25 juin 2012 20:29:45 Hugo Beauzée-Luyssen, vous avez écrit :
> > >>> I am not sure that a vlc_cond_signal outside the lock is valid.
> > >>
> > >> Indeed, missed that :/
> > >> As far as I know it is "valid", but a bad idea. Will fix the patch
> > >> locally.
> > >
> > > Michael Kerrisk writes in "The Linux Programming Interface" that both
> > > are valid, according to SUSv3.
> >
> > It depends how many threads are using the wait condition I guess.
>
> At least, that's my understanding (in general).
>
> Basically, signal after unlocking works in some cases and might be faster
> depending on the implementation. If in doubt, signal should be sent with the
> lock held.
>
> (Also never signal before locking!)
I think some of those good advice should be on the wiki, on the
check-before-sending-for-review page.
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list