[vlc-devel] [PATCH 3/6] demux: adaptive: fix cancellation during refresh playlist

Rémi Denis-Courmont remi at remlab.net
Wed Sep 20 11:46:36 CEST 2017


Le 20 septembre 2017 12:10:37 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo at beauzee.fr> a écrit :
>On Wed, Sep 20, 2017, at 05:49 AM, Zhao Zhili wrote:
>> 
>> This patch fixed a crash due to assert failure since mutex is not
>> unlocked before vlc_mutex_destroy().
>> ---
>>   modules/demux/adaptive/PlaylistManager.cpp | 2 ++
>>   1 file changed, 2 insertions(+)
>> 
>> diff --git a/modules/demux/adaptive/PlaylistManager.cpp 
>> b/modules/demux/adaptive/PlaylistManager.cpp
>> index 3ee5014..706ece0 100644
>> --- a/modules/demux/adaptive/PlaylistManager.cpp
>> +++ b/modules/demux/adaptive/PlaylistManager.cpp
>> @@ -633,10 +633,12 @@ void PlaylistManager::Run()
>> 
>>           if(needsUpdate())
>>           {
>> +            int canc = vlc_savecancel();
>
>This implies that the below functions are cancellation points, and
>therefor a more correct fix (in my opinion) would be to move the call
>the vlc_cleanup_pop right before the mutex gets unlocked, instead of
>disabling cancellation.
>
>>               if(updatePlaylist())
>>                   scheduleNextUpdate();
>>               else
>>                   failedupdates++;
>> +            vlc_restorecancel(canc);
>>           }
>> 
>>           vlc_mutex_lock(&demux.lock);
>> -- 
>> 2.7.4
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>> Email had 1 attachment:
>> + 0003-demux-adaptive-fix-cancellation-during-refresh-playl.patch
>>   1k (text/x-patch)
>
>
>-- 
>  Hugo Beauzée-Luyssen
>  hugo at beauzee.fr
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

Thread cancellation is *not* defined in C++ code at all anyway (except on GNU/Linux where the run-time explicitly supports C++ unwinding in case off cancellation).

I would refrain from reasoning on something undefined.
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list