[vlc-devel] [PATCH] HLS: don't signal dl thread out of the blue in Close()

Rémi Denis-Courmont remi at remlab.net
Wed Jun 27 15:11:41 CEST 2012

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!)

Rémi Denis-Courmont

More information about the vlc-devel mailing list