<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Rémi,</p>
<p>On 2017-03-22 19:44, Rémi Denis-Courmont wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Le keskiviikkona 22. maaliskuuta 2017, 17.58.45 EET Filip Roséen a écrit :</code></pre>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> As we can have incoming requests to the preparser while we are
 destroying libvlc, we can end up in a deadlock while we are removing
 all playlist_item_t from the playlist, while an item being preparsed
 tries to add additional items to the list.

 These changes fixes the issue by introducing a preparser-deactivation
 function, that will make sure that we:

  1) clear out any pending preparsing requests
  2) cancel the current item preparsing (blocking)
  3) prevent further requests to the preparser</code></pre>
</blockquote>
<pre><code> I cannot tell, at this point, if this patch actually solves one instance of 
 the deadlock that is triggered through the preparser. But it cannot solve the 
 deadlock in general, for the simple reason that the deadlock is entirely 
 between playlist, input item and the VLC events nonsens*ahem* framework.</code></pre>
</blockquote>
<p>This patch solves the issue where a playlist_item_t is used to add items to the playlist, while the playlist is trying to release that playlist_item_t (and since both locks the item, we end up in a deadlock).</p>
<p>I think the preparser is the only remaining case where the lock inversion described by #17652 can actually occur in practice, but I might have to do some further investigations on the matter.</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Unless this solves any other problem, this only adds complexity. No thanks.</code></pre>
</blockquote>
<p>I am unable to reproduce any other situation with the current codebase, but testcases are more than welcome!</p>
<p>Best Regards,<br />
Filip Roséen</p>
</body>
</html>