[vlc-devel] [PATCH] HLS: remove some useless mutex locks
Rémi Denis-Courmont
remi at remlab.net
Tue Feb 7 16:54:36 CET 2012
Le mardi 7 février 2012 16:26:26 Hugo Beauzée-Luyssen, vous avez écrit :
> 2012/2/7 Frédéric Yhuel <fyhuel at viotech.net>:
> > ---
> > modules/stream_filter/httplive.c | 4 ----
> > 1 files changed, 0 insertions(+), 4 deletions(-)
> >
> > diff --git a/modules/stream_filter/httplive.c
> > b/modules/stream_filter/httplive.c index c03061b..9afd5c0 100644
> > --- a/modules/stream_filter/httplive.c
> > +++ b/modules/stream_filter/httplive.c
> > @@ -2070,9 +2070,7 @@ static void Close(vlc_object_t *p_this)
> > assert(p_sys->hls_stream);
> >
> > /* */
> > - vlc_mutex_lock(&p_sys->download.lock_wait);
> > vlc_cond_signal(&p_sys->download.wait);
> > - vlc_mutex_unlock(&p_sys->download.lock_wait);
>
> This mutex isn't useless, if you don't hold it before calling
> vlc_cond_signal there is no way of being sure the thread is actually
> waiting.
The code is wrong EITHER way.
Calling vlc_cond_signal() out of the blue makes no sense.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the vlc-devel
mailing list