[vlc-devel] [PATCH] rtsp.c deadlock

Laurent Aimar fenrir at via.ecp.fr
Mon Dec 1 09:35:59 CET 2008

On Mon, Dec 01, 2008, Sébastien Escudier wrote:
> Quoting Laurent Aimar <fenrir at via.ecp.fr>:
> > > This patch unlock lock_media mutex before sending a vod_MediaControl,
> > because we
> > > won't access p_sys->media[] anymore at this point.
> >  It is invalid. The array is not accessed anymore by the thread but p_media
> > is.
> > The lock protect both the array AND the element inside it.
> I looked again, and I see two possible lock :
> lock_media is part of vod_sys_t, and declared as :
>     /* List of media */
>     vlc_mutex_t lock_media;
> So I would say this lock is only for the list (p_sys->media[]) .
> To lock the media itself there is another lock inside vod_media_t :
> p_media->lock
 The destruction of the media is protected by the same lock than p_sys->media[].
It protects the list of media and so wheither a media is present or not. You may
have a look at MediaDel.

> Is my patch really invalid ?
 I think so.


More information about the vlc-devel mailing list