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

Sébastien Escudier sebastien-devel at celeos.eu
Fri Nov 28 12:12:19 CET 2008


There is a deadlock in rtsp.c, this patch should solve it.
To see a description of the deadlock, read the end of this mail.

This patch unlock lock_media mutex before sending a vod_MediaControl, because we
won't access p_sys->media[] anymore at this point.
It avoid having lock_media and then vlm mutex locked at the same time here.

So how the deadlock can happen :

* Thread 1
add a vod media in vlm
so it locks vlm mutex
* Thread 2 (rtsp.c : CommandThread)
lock lock_media mutex
issue a command (vod_MediaControl)
try to lock vlm mutex (already locked in Thread 1)
* Thread 1
create the new media (rtsp.c : MediaNew)
lock lock_media mutex (already locked in Thread 2)

-> deadlock
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-unlock-media-mutex-when-not-needed-anymore.patch
Type: text/x-diff
Size: 1065 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081128/7d45492e/attachment.patch>

More information about the vlc-devel mailing list