1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00

lua: remove cargo-cultivated cancellation

This commit is contained in:
Rémi Denis-Courmont 2016-11-19 00:26:02 +02:00
parent 6acc10eb1c
commit 7a94f2e6b2
2 changed files with 5 additions and 10 deletions

View File

@ -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 );

View File

@ -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 );