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
360eeee3
Commit
360eeee3
authored
Sep 19, 2008
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: only use sync_ on GGCs that have it.
This fixes [
d635ae4e
]
parent
fa79d12d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
src/libvlc.c
src/libvlc.c
+9
-3
No files found.
src/libvlc.c
View file @
360eeee3
...
...
@@ -76,6 +76,12 @@
# include <hal/libhal.h>
#endif
#if defined(__GNUC__)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 0)
#define USE_SYNC
#endif
#endif
#include <vlc_playlist.h>
#include <vlc_interface.h>
...
...
@@ -119,7 +125,7 @@ void *vlc_gc_init (gc_object_t *p_gc, void (*pf_destruct) (gc_object_t *))
p_gc
->
pf_destructor
=
pf_destruct
;
p_gc
->
refs
=
1
;
#ifdef
__GNUC__
#ifdef
USE_SYNC
__sync_synchronize
();
#else
/* Nobody else can possibly lock the spin - it's there as a barrier */
...
...
@@ -140,7 +146,7 @@ void *vlc_hold (gc_object_t * p_gc)
uintptr_t
refs
;
assert
(
p_gc
);
#ifdef
__GNUC__
#ifdef
USE_SYNC
refs
=
__sync_fetch_and_add
(
&
p_gc
->
refs
,
1
);
#else
vlc_spin_lock
(
&
p_gc
->
spin
);
...
...
@@ -161,7 +167,7 @@ void vlc_release (gc_object_t *p_gc)
assert
(
p_gc
);
#ifdef
__GNUC__
#ifdef
USE_SYNC
refs
=
__sync_fetch_and_sub
(
&
p_gc
->
refs
,
1
);
#else
vlc_spin_lock
(
&
p_gc
->
spin
);
...
...
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