Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7031f81c
Commit
7031f81c
authored
Jun 16, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: extension: simplify command dequeuing
parent
886de66d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
modules/lua/extension_thread.c
modules/lua/extension_thread.c
+12
-15
No files found.
modules/lua/extension_thread.c
View file @
7031f81c
...
...
@@ -325,13 +325,22 @@ static void* Run( void *data )
while
(
!
p_ext
->
p_sys
->
b_exiting
)
{
/* Pop command in front */
struct
command_t
*
cmd
=
p_ext
->
p_sys
->
command
;
/* Pop command in front */
if
(
cmd
==
NULL
)
{
vlc_cond_wait
(
&
p_ext
->
p_sys
->
wait
,
&
p_ext
->
p_sys
->
command_lock
);
continue
;
}
p_ext
->
p_sys
->
command
=
cmd
->
next
;
cmd
->
next
=
NULL
;
/* unlink command (for FreeCommands()) */
vlc_mutex_unlock
(
&
p_ext
->
p_sys
->
command_lock
);
vlc_restorecancel
(
cancel
);
/* Run command */
if
(
cmd
)
if
(
true
)
{
if
(
LockExtension
(
p_ext
)
)
{
...
...
@@ -344,7 +353,6 @@ static void* Run( void *data )
{
msg_Err
(
p_mgr
,
"Could not activate extension!"
);
Deactivate
(
p_mgr
,
p_ext
);
cmd
=
NULL
;
}
break
;
}
...
...
@@ -422,21 +430,10 @@ static void* Run( void *data )
UnlockExtension
(
p_ext
);
}
}
FreeCommands
(
cmd
);
cancel
=
vlc_savecancel
();
vlc_mutex_lock
(
&
p_ext
->
p_sys
->
command_lock
);
if
(
p_ext
->
p_sys
->
command
)
{
cmd
=
p_ext
->
p_sys
->
command
;
p_ext
->
p_sys
->
command
=
cmd
->
next
;
cmd
->
next
=
NULL
;
// This prevents FreeCommands from freeing next
FreeCommands
(
cmd
);
}
if
(
!
p_ext
->
p_sys
->
b_exiting
&&
!
p_ext
->
p_sys
->
command
)
{
vlc_cond_wait
(
&
p_ext
->
p_sys
->
wait
,
&
p_ext
->
p_sys
->
command_lock
);
}
}
vlc_mutex_unlock
(
&
p_ext
->
p_sys
->
command_lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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