Commit ce3fbfca authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

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 7a94f2e6
Fix #17565
parent 88986e0b
...@@ -1223,8 +1223,8 @@ static void WatchTimerCallback( void *data ) ...@@ -1223,8 +1223,8 @@ static void WatchTimerCallback( void *data )
vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id ); vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
p_ext->p_sys->p_progress_id = NULL; p_ext->p_sys->p_progress_id = NULL;
} }
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock ); vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
return; return;
} }
...@@ -1239,8 +1239,8 @@ static void WatchTimerCallback( void *data ) ...@@ -1239,8 +1239,8 @@ static void WatchTimerCallback( void *data )
p_ext->psz_title ); p_ext->psz_title );
if( p_ext->p_sys->p_progress_id == NULL ) if( p_ext->p_sys->p_progress_id == NULL )
{ {
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock ); vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
return; return;
} }
vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 ); vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 );
...@@ -1251,8 +1251,8 @@ static void WatchTimerCallback( void *data ) ...@@ -1251,8 +1251,8 @@ static void WatchTimerCallback( void *data )
{ {
vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id ); vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
p_ext->p_sys->p_progress_id = NULL; p_ext->p_sys->p_progress_id = NULL;
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock ); vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
return; return;
} }
vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 ); vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 );
......
...@@ -153,8 +153,8 @@ int Deactivate( extensions_manager_t *p_mgr, extension_t *p_ext ) ...@@ -153,8 +153,8 @@ int Deactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
// Extension is stuck, kill it now // Extension is stuck, kill it now
vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id ); vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
p_ext->p_sys->p_progress_id = NULL; p_ext->p_sys->p_progress_id = NULL;
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock ); vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -217,8 +217,10 @@ void KillExtension( extensions_manager_t *p_mgr, extension_t *p_ext ) ...@@ -217,8 +217,10 @@ void KillExtension( extensions_manager_t *p_mgr, extension_t *p_ext )
{ {
msg_Dbg( p_mgr, "Killing extension now" ); msg_Dbg( p_mgr, "Killing extension now" );
lua_ExtensionDeactivate( p_mgr, p_ext ); lua_ExtensionDeactivate( p_mgr, p_ext );
vlc_mutex_lock( &p_ext->p_sys->command_lock );
p_ext->p_sys->b_exiting = true; p_ext->p_sys->b_exiting = true;
vlc_cond_signal( &p_ext->p_sys->wait ); vlc_cond_signal( &p_ext->p_sys->wait );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
RemoveActivated( p_mgr, p_ext ); RemoveActivated( p_mgr, p_ext );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment