Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
da673206
Commit
da673206
authored
Jul 05, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_object_alive: lock-less and inlined
parent
06e3b333
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
31 deletions
+7
-31
include/vlc_objects.h
include/vlc_objects.h
+6
-1
src/libvlccore.sym
src/libvlccore.sym
+0
-1
src/misc/objects.c
src/misc/objects.c
+1
-29
No files found.
include/vlc_objects.h
View file @
da673206
...
...
@@ -162,7 +162,12 @@ VLC_EXPORT( void, __vlc_object_kill, ( vlc_object_t * ) );
#define vlc_object_kill(a) \
__vlc_object_kill( VLC_OBJECT(a) )
VLC_EXPORT
(
bool
,
__vlc_object_alive
,
(
vlc_object_t
*
)
);
static
inline
bool
__vlc_object_alive
(
vlc_object_t
*
obj
)
{
barrier
();
return
!
obj
->
b_die
;
}
#define vlc_object_alive(a) \
__vlc_object_alive( VLC_OBJECT(a) )
...
...
src/libvlccore.sym
View file @
da673206
...
...
@@ -433,7 +433,6 @@ vlc_module_set
__vlc_mutex_destroy
vlc_mutex_init
vlc_mutex_init_recursive
__vlc_object_alive
__vlc_object_attach
__vlc_object_create
__vlc_object_detach
...
...
src/misc/objects.c
View file @
da673206
...
...
@@ -546,35 +546,6 @@ int __vlc_object_timedwait( vlc_object_t *obj, mtime_t deadline )
}
/**
* Checks whether an object has been "killed".
* The object lock must be held.
*
* Typical code for an object thread could be:
*
vlc_object_lock (self);
...initialization...
while (vlc_object_alive (self))
{
...preprocessing...
vlc_object_wait (self);
...postprocessing...
}
...deinitialization...
vlc_object_unlock (self);
*
*
* @return true iff the object has not been killed yet
*/
bool
__vlc_object_alive
(
vlc_object_t
*
obj
)
{
vlc_assert_locked
(
&
(
vlc_internals
(
obj
)
->
lock
)
);
return
!
obj
->
b_die
;
}
/**
* Signals an object for which the lock is held.
* At least one thread currently sleeping in vlc_object_wait() or
...
...
@@ -613,6 +584,7 @@ void __vlc_object_kill( vlc_object_t *p_this )
}
vlc_object_signal_unlocked
(
p_this
);
/* This also serves as a memory barrier toward vlc_object_alive(): */
vlc_object_unlock
(
p_this
);
}
...
...
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