Commit bd8d39bc authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

lua: Mandate KillExtension to be called with command_lock locked

Otherwise the caller always unlocks the lock, only to have it acquire
again by KillExtension.
parent 6e17f399
......@@ -1166,8 +1166,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;
}
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
return;
}
......@@ -1182,8 +1182,8 @@ static void WatchTimerCallback( void *data )
p_ext->psz_title );
if( p_ext->p_sys->p_progress_id == NULL )
{
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
return;
}
vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 );
......@@ -1194,8 +1194,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;
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
return;
}
vlc_timer_schedule( p_ext->p_sys->timer, false, 100000, 0 );
......
......@@ -152,8 +152,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;
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
return VLC_SUCCESS;
}
......@@ -163,16 +163,14 @@ int Deactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
return b_success ? VLC_SUCCESS : VLC_ENOMEM;
}
/* MUST be called with command_lock held */
void KillExtension( extensions_manager_t *p_mgr, extension_t *p_ext )
{
msg_Dbg( p_mgr, "Killing extension now" );
vlclua_fd_interrupt( &p_ext->p_sys->dtable );
vlc_mutex_lock( &p_ext->p_sys->command_lock );
p_ext->p_sys->b_activated = false;
p_ext->p_sys->b_exiting = true;
vlc_cond_signal( &p_ext->p_sys->wait );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
}
/** Push a UI command */
......
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