Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
7a94f2e6
Commit
7a94f2e6
authored
Nov 19, 2016
by
Rémi Denis-Courmont
Browse files
lua: remove cargo-cultivated cancellation
parent
6acc10eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/lua/extension.c
View file @
7a94f2e6
...
...
@@ -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
);
...
...
modules/lua/extension_thread.c
View file @
7a94f2e6
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment