Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3cbb926a
Commit
3cbb926a
authored
Mar 04, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Privatize the playlist lock
parent
7b5dea4e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
src/playlist/control.c
src/playlist/control.c
+3
-3
src/playlist/engine.c
src/playlist/engine.c
+2
-0
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+1
-0
src/playlist/thread.c
src/playlist/thread.c
+2
-4
No files found.
src/playlist/control.c
View file @
3cbb926a
...
@@ -68,17 +68,17 @@ void __pl_Release( vlc_object_t *p_this )
...
@@ -68,17 +68,17 @@ void __pl_Release( vlc_object_t *p_this )
void
playlist_Lock
(
playlist_t
*
pl
)
void
playlist_Lock
(
playlist_t
*
pl
)
{
{
vlc_
object_lock
(
pl
);
vlc_
mutex_lock
(
&
pl_priv
(
pl
)
->
lock
);
}
}
void
playlist_Unlock
(
playlist_t
*
pl
)
void
playlist_Unlock
(
playlist_t
*
pl
)
{
{
vlc_
object_unlock
(
pl
);
vlc_
mutex_unlock
(
&
pl_priv
(
pl
)
->
lock
);
}
}
void
playlist_AssertLocked
(
playlist_t
*
pl
)
void
playlist_AssertLocked
(
playlist_t
*
pl
)
{
{
vlc_
object_assert_locked
(
pl
);
vlc_
assert_locked
(
&
pl_priv
(
pl
)
->
lock
);
}
}
int
playlist_Control
(
playlist_t
*
p_playlist
,
int
i_query
,
int
playlist_Control
(
playlist_t
*
p_playlist
,
int
i_query
,
...
...
src/playlist/engine.c
View file @
3cbb926a
...
@@ -81,6 +81,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
...
@@ -81,6 +81,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
libvlc_priv
(
p_parent
->
p_libvlc
)
->
p_playlist
=
p_playlist
;
libvlc_priv
(
p_parent
->
p_libvlc
)
->
p_playlist
=
p_playlist
;
VariablesInit
(
p_playlist
);
VariablesInit
(
p_playlist
);
vlc_mutex_init
(
&
p
->
lock
);
vlc_cond_init
(
&
p
->
signal
);
vlc_cond_init
(
&
p
->
signal
);
/* Initialise data structures */
/* Initialise data structures */
...
@@ -181,6 +182,7 @@ static void playlist_Destructor( vlc_object_t * p_this )
...
@@ -181,6 +182,7 @@ static void playlist_Destructor( vlc_object_t * p_this )
assert
(
!
p_sys
->
p_fetcher
);
assert
(
!
p_sys
->
p_fetcher
);
vlc_cond_destroy
(
&
p_sys
->
signal
);
vlc_cond_destroy
(
&
p_sys
->
signal
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
/* Remove all remaining items */
/* Remove all remaining items */
FOREACH_ARRAY
(
playlist_item_t
*
p_del
,
p_playlist
->
all_items
)
FOREACH_ARRAY
(
playlist_item_t
*
p_del
,
p_playlist
->
all_items
)
...
...
src/playlist/playlist_internal.h
View file @
3cbb926a
...
@@ -83,6 +83,7 @@ typedef struct playlist_private_t
...
@@ -83,6 +83,7 @@ typedef struct playlist_private_t
}
request
;
}
request
;
vlc_thread_t
thread
;
/**< engine thread */
vlc_thread_t
thread
;
/**< engine thread */
vlc_mutex_t
lock
;
/**< dah big playlist global lock */
vlc_cond_t
signal
;
/**< wakes up the playlist engine thread */
vlc_cond_t
signal
;
/**< wakes up the playlist engine thread */
int
i_last_playlist_id
;
/**< Last id to an item */
int
i_last_playlist_id
;
/**< Last id to an item */
...
...
src/playlist/thread.c
View file @
3cbb926a
...
@@ -552,8 +552,7 @@ static void LoopRequest( playlist_t *p_playlist )
...
@@ -552,8 +552,7 @@ static void LoopRequest( playlist_t *p_playlist )
else
else
{
{
if
(
vlc_object_alive
(
p_playlist
)
)
if
(
vlc_object_alive
(
p_playlist
)
)
vlc_cond_wait
(
&
pl_priv
(
p_playlist
)
->
signal
,
vlc_cond_wait
(
&
p_sys
->
signal
,
&
p_sys
->
lock
);
&
vlc_internals
(
p_playlist
)
->
lock
);
}
}
return
;
return
;
}
}
...
@@ -598,8 +597,7 @@ static void *Thread ( void *data )
...
@@ -598,8 +597,7 @@ static void *Thread ( void *data )
/* If there is an input, check that it doesn't need to die. */
/* If there is an input, check that it doesn't need to die. */
while
(
!
LoopInput
(
p_playlist
)
)
while
(
!
LoopInput
(
p_playlist
)
)
vlc_cond_wait
(
&
pl_priv
(
p_playlist
)
->
signal
,
vlc_cond_wait
(
&
p_sys
->
signal
,
&
p_sys
->
lock
);
&
vlc_internals
(
p_playlist
)
->
lock
);
LoopRequest
(
p_playlist
);
LoopRequest
(
p_playlist
);
}
}
...
...
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