Commit 7a94f2e6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

lua: remove cargo-cultivated cancellation

parent 6acc10eb
......@@ -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;
}
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
KillExtension( p_mgr, p_ext );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
return;
}
......@@ -1239,8 +1239,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 );
......@@ -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;
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 );
......
......@@ -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;
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;
}
......@@ -215,11 +215,10 @@ static int RemoveActivated( extensions_manager_t *p_mgr, extension_t *p_ext )
void KillExtension( extensions_manager_t *p_mgr, extension_t *p_ext )
{
/* Cancel thread if it seems stuck for a while */
msg_Dbg( p_mgr, "Killing extension now" );
vlc_cancel( p_ext->p_sys->thread );
lua_ExtensionDeactivate( p_mgr, p_ext );
p_ext->p_sys->b_exiting = true;
vlc_cond_signal( &p_ext->p_sys->wait );
RemoveActivated( p_mgr, p_ext );
}
......@@ -318,7 +317,6 @@ static void* Run( void *data )
extensions_manager_t *p_mgr = p_ext->p_sys->p_mgr;
vlc_mutex_lock( &p_ext->p_sys->command_lock );
mutex_cleanup_push( &p_ext->p_sys->command_lock );
while( !p_ext->p_sys->b_exiting )
{
......@@ -336,7 +334,6 @@ static void* Run( void *data )
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
/* Run command */
int cancel = vlc_savecancel();
if( LockExtension( p_ext ) )
{
switch( cmd->i_command )
......@@ -423,11 +420,9 @@ static void* Run( void *data )
}
FreeCommands( cmd );
vlc_restorecancel( cancel );
vlc_mutex_lock( &p_ext->p_sys->command_lock );
}
vlc_cleanup_pop( );
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
msg_Dbg( p_mgr, "Extension thread end: '%s'", p_ext->psz_title );
......
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