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
d7899cfa
Commit
d7899cfa
authored
Nov 16, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block_FifoPut: reduce contention scope
parent
211199d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
src/misc/block.c
src/misc/block.c
+13
-12
No files found.
src/misc/block.c
View file @
d7899cfa
...
...
@@ -566,25 +566,26 @@ void block_FifoPace (block_fifo_t *fifo, size_t max_depth, size_t max_size)
* Immediately queue one block at the end of a FIFO.
* @param fifo queue
* @param block head of a block list to queue (may be NULL)
* @return total number of bytes appended to the queue
*/
size_t
block_FifoPut
(
block_fifo_t
*
p_fifo
,
block_t
*
p_block
)
{
size_t
i_size
=
0
;
vlc_mutex_lock
(
&
p_fifo
->
lock
);
size_t
i_size
=
0
,
i_depth
=
0
;
while
(
p_block
!=
NULL
)
if
(
p_block
==
NULL
)
return
0
;
for
(
block_t
*
b
=
p_block
;
b
!=
NULL
;
b
=
b
->
p_next
)
{
i_size
+=
p_block
->
i_buffer
;
*
p_fifo
->
pp_last
=
p_block
;
p_fifo
->
pp_last
=
&
p_block
->
p_next
;
p_fifo
->
i_depth
++
;
p_fifo
->
i_size
+=
p_block
->
i_buffer
;
p_block
=
p_block
->
p_next
;
i_size
+=
b
->
i_buffer
;
i_depth
++
;
}
/* We queued one block: wake up one read-waiting thread */
vlc_mutex_lock
(
&
p_fifo
->
lock
);
*
p_fifo
->
pp_last
=
p_block
;
p_fifo
->
pp_last
=
&
p_block
->
p_next
;
p_fifo
->
i_depth
+=
i_depth
;
p_fifo
->
i_size
+=
i_size
;
/* We queued at least one block: wake up one read-waiting thread */
vlc_cond_signal
(
&
p_fifo
->
wait
);
vlc_mutex_unlock
(
&
p_fifo
->
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