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
e21ba63b
Commit
e21ba63b
authored
Jun 17, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move object lock and condition into the internals
parent
838cee47
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
34 deletions
+34
-34
include/vlc_common.h
include/vlc_common.h
+0
-4
include/vlc_plugin.h
include/vlc_plugin.h
+2
-2
src/libvlc.h
src/libvlc.h
+12
-10
src/misc/objects.c
src/misc/objects.c
+16
-14
src/modules/cache.c
src/modules/cache.c
+1
-1
src/modules/entry.c
src/modules/entry.c
+1
-1
src/playlist/engine.c
src/playlist/engine.c
+2
-2
No files found.
include/vlc_common.h
View file @
e21ba63b
...
...
@@ -513,10 +513,6 @@ typedef struct vlc_object_internals_t vlc_object_internals_t;
char *psz_header; \
int i_flags; \
\
/* Object access lock */
\
vlc_mutex_t object_lock; \
vlc_cond_t object_wait; \
\
/* Object properties */
\
volatile bool b_error;
/**< set by the object */
\
volatile bool b_die;
/**< set by the outside */
\
...
...
include/vlc_plugin.h
View file @
e21ba63b
...
...
@@ -34,8 +34,8 @@
/**
* Current plugin ABI version
*/
# define MODULE_SYMBOL 0_9_0
k
# define MODULE_SUFFIX "__0_9_0
k
"
# define MODULE_SYMBOL 0_9_0
l
# define MODULE_SUFFIX "__0_9_0
l
"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
...
...
src/libvlc.h
View file @
e21ba63b
...
...
@@ -142,16 +142,6 @@ extern void *
vlc_custom_create
(
vlc_object_t
*
p_this
,
size_t
i_size
,
int
i_type
,
const
char
*
psz_type
);
/* Signal an object without checking for locking consistency. This is wrong. */
#ifdef __GNUC__
__attribute__
((
deprecated
))
#endif
static
inline
void
vlc_object_signal_maybe
(
vlc_object_t
*
p_this
)
{
vlc_cond_signal
(
&
p_this
->
object_wait
);
}
/**
* libvlc_global_data_t (global variable)
*
...
...
@@ -189,6 +179,8 @@ struct vlc_object_internals_t
bool
b_thread
;
/* Objects thread synchronization */
vlc_mutex_t
lock
;
vlc_cond_t
wait
;
int
pipes
[
2
];
vlc_spinlock_t
spin
;
...
...
@@ -214,6 +206,16 @@ struct vlc_object_internals_t
#define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
/* Signal an object without checking for locking consistency. This is wrong. */
#ifdef __GNUC__
__attribute__
((
deprecated
))
#endif
static
inline
void
vlc_object_signal_maybe
(
vlc_object_t
*
p_this
)
{
vlc_cond_signal
(
&
(
vlc_internals
(
p_this
)
->
wait
));
}
/**
* Private LibVLC instance data.
*/
...
...
src/misc/objects.c
View file @
e21ba63b
...
...
@@ -176,8 +176,8 @@ void *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
p_new
->
p_private
=
NULL
;
/* Initialize mutexes and condvars */
vlc_mutex_init
(
&
p_
new
->
object_
lock
);
vlc_cond_init
(
p_new
,
&
p_
new
->
object_
wait
);
vlc_mutex_init
(
&
p_
priv
->
lock
);
vlc_cond_init
(
p_new
,
&
p_
priv
->
wait
);
vlc_mutex_init
(
&
p_priv
->
var_lock
);
vlc_spin_init
(
&
p_priv
->
spin
);
p_priv
->
pipes
[
0
]
=
p_priv
->
pipes
[
1
]
=
-
1
;
...
...
@@ -387,8 +387,8 @@ static void vlc_object_destroy( vlc_object_t *p_this )
#endif
vlc_spin_destroy
(
&
p_priv
->
ref_spin
);
vlc_mutex_destroy
(
&
p_
this
->
object_
lock
);
vlc_cond_destroy
(
&
p_
this
->
object_
wait
);
vlc_mutex_destroy
(
&
p_
priv
->
lock
);
vlc_cond_destroy
(
&
p_
priv
->
wait
);
vlc_spin_destroy
(
&
p_priv
->
spin
);
if
(
p_priv
->
pipes
[
1
]
!=
-
1
)
close
(
p_priv
->
pipes
[
1
]
);
...
...
@@ -403,13 +403,13 @@ static void vlc_object_destroy( vlc_object_t *p_this )
void
__vlc_object_lock
(
vlc_object_t
*
obj
)
{
vlc_mutex_lock
(
&
obj
->
object_lock
);
vlc_mutex_lock
(
&
(
vlc_internals
(
obj
)
->
lock
)
);
}
void
__vlc_object_unlock
(
vlc_object_t
*
obj
)
{
vlc_assert_locked
(
&
obj
->
object_lock
);
vlc_mutex_unlock
(
&
obj
->
object_lock
);
vlc_assert_locked
(
&
(
vlc_internals
(
obj
)
->
lock
)
);
vlc_mutex_unlock
(
&
(
vlc_internals
(
obj
)
->
lock
)
);
}
#ifdef WIN32
...
...
@@ -540,8 +540,9 @@ int __vlc_object_waitpipe( vlc_object_t *obj )
*/
void
__vlc_object_wait
(
vlc_object_t
*
obj
)
{
vlc_assert_locked
(
&
obj
->
object_lock
);
vlc_cond_wait
(
&
obj
->
object_wait
,
&
obj
->
object_lock
);
vlc_object_internals_t
*
priv
=
vlc_internals
(
obj
);
vlc_assert_locked
(
&
priv
->
lock
);
vlc_cond_wait
(
&
priv
->
wait
,
&
priv
->
lock
);
}
...
...
@@ -554,8 +555,9 @@ void __vlc_object_wait( vlc_object_t *obj )
*/
int
__vlc_object_timedwait
(
vlc_object_t
*
obj
,
mtime_t
deadline
)
{
vlc_assert_locked
(
&
obj
->
object_lock
);
return
vlc_cond_timedwait
(
&
obj
->
object_wait
,
&
obj
->
object_lock
,
deadline
);
vlc_object_internals_t
*
priv
=
vlc_internals
(
obj
);
vlc_assert_locked
(
&
priv
->
lock
);
return
vlc_cond_timedwait
(
&
priv
->
wait
,
&
priv
->
lock
,
deadline
);
}
...
...
@@ -583,7 +585,7 @@ int __vlc_object_timedwait( vlc_object_t *obj, mtime_t deadline )
*/
bool
__vlc_object_alive
(
vlc_object_t
*
obj
)
{
vlc_assert_locked
(
&
obj
->
object_lock
);
vlc_assert_locked
(
&
(
vlc_internals
(
obj
)
->
lock
)
);
return
!
obj
->
b_die
;
}
...
...
@@ -597,8 +599,8 @@ bool __vlc_object_alive( vlc_object_t *obj )
*/
void
__vlc_object_signal_unlocked
(
vlc_object_t
*
obj
)
{
vlc_assert_locked
(
&
obj
->
object_lock
);
vlc_cond_signal
(
&
obj
->
object_wait
);
vlc_assert_locked
(
&
(
vlc_internals
(
obj
)
->
lock
)
);
vlc_cond_signal
(
&
(
vlc_internals
(
obj
)
->
wait
)
);
}
...
...
src/modules/cache.c
View file @
e21ba63b
...
...
@@ -379,7 +379,7 @@ static int CacheLoadConfig( module_t *p_module, FILE *file )
p_module
->
p_config
[
i
].
b_dirty
=
false
;
p_module
->
p_config
[
i
].
p_lock
=
&
p_module
->
object_lock
;
p_module
->
p_config
[
i
].
p_lock
=
&
(
vlc_internals
(
p_module
)
->
lock
)
;
if
(
p_module
->
p_config
[
i
].
i_list
)
{
...
...
src/modules/entry.c
View file @
e21ba63b
...
...
@@ -220,7 +220,7 @@ module_config_t *vlc_config_create (module_t *module, int type)
memset
(
tab
+
confsize
,
0
,
sizeof
(
tab
[
confsize
]));
tab
[
confsize
].
i_type
=
type
;
tab
[
confsize
].
p_lock
=
&
module
->
object_lock
;
tab
[
confsize
].
p_lock
=
&
(
vlc_internals
(
module
)
->
lock
)
;
if
(
type
&
CONFIG_ITEM
)
{
...
...
src/playlist/engine.c
View file @
e21ba63b
...
...
@@ -225,7 +225,7 @@ static void input_selected_stream_changed( const vlc_event_t * event, void * dat
/* Internals */
void
playlist_release_current_input
(
playlist_t
*
p_playlist
)
{
vlc_assert_locked
(
&
p_playlist
->
object_lock
);
vlc_assert_locked
(
&
(
vlc_internals
(
p_playlist
)
->
lock
)
);
if
(
!
p_playlist
->
p_input
)
return
;
...
...
@@ -248,7 +248,7 @@ void playlist_release_current_input( playlist_t * p_playlist )
void
playlist_set_current_input
(
playlist_t
*
p_playlist
,
input_thread_t
*
p_input
)
{
vlc_assert_locked
(
&
p_playlist
->
object_lock
);
vlc_assert_locked
(
&
(
vlc_internals
(
p_playlist
)
->
lock
)
);
playlist_release_current_input
(
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