<html><head></head><body>Hi,<br><br>Maybe, haven't checked.<br><br>If the lock is always acquired and released in the same call, it can be converted to mutex. But if a function can acquire the lock, then return without releasing, then it probably must remain a semaphore <br><br><div class="gmail_quote">Le 24 septembre 2019 10:41:19 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2019-09-23 18:25, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Hi,<br><br>I don't know exactly what synchronisation was needed then and now for avcodec per se, as opposed to what Laurent did for old VLC core or just out of uncertainty.<br><br>But there is one difference between a semaphore lock and a mutex lock. The earlier can be released from a different thread than the one which acquired it. The splitter uses semaphores for that reason: it cannot assume that the releasing thread is the acquiring thread.<br></blockquote><br>I think in the case of lavc it's only used to protect some variables <br>between the lavc decoder thread(s) and VLC decoder/input thread, not to <br>adjust the order in which threads are allowed to run.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le 23 septembre 2019 13:49:14 GMT+03:00, Francois Cartegnie <fcvlcdev@free.fr> a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">Le 23/09/2019 à 10:51, Thomas Guillem a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">It's just a 0/1 semaphore. I don't really know why we use a semaphore<br></blockquote>here instead of a mutex.<br> Dates from early avcodec threading.<br> The usual comment is : is that still needed ?<br><br> -- <br> Francois Cartegnie<br> VideoLAN - VLC Developer<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>