[vlc-commits] lua: Fix deadlock when deactivating extension due to timeout.
Hugo Beauzée-Luyssen
git at videolan.org
Thu Mar 30 13:56:31 CEST 2017
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 27 15:17:42 2017 +0200| [ce3fbfca7c24176e1822b3263db868cd0116af4f] | committer: Hugo Beauzée-Luyssen
lua: Fix deadlock when deactivating extension due to timeout.
lua_ExecuteFunctionVa is not meant to be called with the command_lock
held.
This partially reverts 7a94f2e6b22bad255ddcca6e095ed33bc4803e45
Fix #17565
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce3fbfca7c24176e1822b3263db868cd0116af4f
---
modules/lua/extension.c | 6 +++---
modules/lua/extension_thread.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/lua/extension.c b/modules/lua/extension.c
index 92c2eb7..32009cc 100644
--- a/modules/lua/extension.c
+++ b/modules/lua/extension.c
@@ -1223,8 +1223,8 @@ static void WatchTimerCallback( void *data )
vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
p_ext->p_sys->p_progress_id = NULL;
}
- KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
+ KillExtension( p_mgr, p_ext );
return;
}
@@ -1239,8 +1239,8 @@ static void WatchTimerCallback( void *data )
p_ext->psz_title );
if( p_ext->p_sys->p_progress_id == NULL )
{
- KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
+ KillExtension( p_mgr, p_ext );
return;
}
vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 );
@@ -1251,8 +1251,8 @@ static void WatchTimerCallback( void *data )
{
vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
p_ext->p_sys->p_progress_id = NULL;
- KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
+ KillExtension( p_mgr, p_ext );
return;
}
vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 );
diff --git a/modules/lua/extension_thread.c b/modules/lua/extension_thread.c
index affa659..6cf3ca6 100644
--- a/modules/lua/extension_thread.c
+++ b/modules/lua/extension_thread.c
@@ -153,8 +153,8 @@ int Deactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
// Extension is stuck, kill it now
vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
p_ext->p_sys->p_progress_id = NULL;
- KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
+ KillExtension( p_mgr, p_ext );
return VLC_SUCCESS;
}
@@ -217,8 +217,10 @@ void KillExtension( extensions_manager_t *p_mgr, extension_t *p_ext )
{
msg_Dbg( p_mgr, "Killing extension now" );
lua_ExtensionDeactivate( p_mgr, p_ext );
+ vlc_mutex_lock( &p_ext->p_sys->command_lock );
p_ext->p_sys->b_exiting = true;
vlc_cond_signal( &p_ext->p_sys->wait );
+ vlc_mutex_unlock( &p_ext->p_sys->command_lock );
RemoveActivated( p_mgr, p_ext );
}
More information about the vlc-commits
mailing list