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
6dbf7ce4
Commit
6dbf7ce4
authored
May 20, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Use a separate lock for media_list_lock and refcounting.
Those finer grained locks help the media_list_player.
parent
1c53f2aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
src/control/libvlc_internal.h
src/control/libvlc_internal.h
+1
-0
src/control/media_list.c
src/control/media_list.c
+6
-5
No files found.
src/control/libvlc_internal.h
View file @
6dbf7ce4
...
...
@@ -90,6 +90,7 @@ struct libvlc_media_list_t
libvlc_instance_t
*
p_libvlc_instance
;
int
i_refcount
;
vlc_mutex_t
object_lock
;
vlc_mutex_t
refcount_lock
;
libvlc_media_t
*
p_md
;
/* The media from which the
* mlist comes, if any. */
vlc_array_t
items
;
...
...
src/control/media_list.c
View file @
6dbf7ce4
...
...
@@ -170,6 +170,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
}
vlc_mutex_init
(
&
p_mlist
->
object_lock
);
vlc_mutex_init
(
&
p_mlist
->
refcount_lock
);
// FIXME: spinlock?
vlc_array_init
(
&
p_mlist
->
items
);
p_mlist
->
i_refcount
=
1
;
...
...
@@ -188,14 +189,14 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
libvlc_media_t
*
p_md
;
int
i
;
vlc_mutex_lock
(
&
p_mlist
->
objec
t_lock
);
vlc_mutex_lock
(
&
p_mlist
->
refcoun
t_lock
);
p_mlist
->
i_refcount
--
;
if
(
p_mlist
->
i_refcount
>
0
)
{
vlc_mutex_unlock
(
&
p_mlist
->
objec
t_lock
);
vlc_mutex_unlock
(
&
p_mlist
->
refcoun
t_lock
);
return
;
}
vlc_mutex_unlock
(
&
p_mlist
->
objec
t_lock
);
vlc_mutex_unlock
(
&
p_mlist
->
refcoun
t_lock
);
/* Refcount null, time to free */
...
...
@@ -222,9 +223,9 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
**************************************************************************/
void
libvlc_media_list_retain
(
libvlc_media_list_t
*
p_mlist
)
{
vlc_mutex_lock
(
&
p_mlist
->
objec
t_lock
);
vlc_mutex_lock
(
&
p_mlist
->
refcoun
t_lock
);
p_mlist
->
i_refcount
++
;
vlc_mutex_unlock
(
&
p_mlist
->
objec
t_lock
);
vlc_mutex_unlock
(
&
p_mlist
->
refcoun
t_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