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
63d5e98c
Commit
63d5e98c
authored
May 11, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_timer_*: use atomic_*() functions
parent
fd146628
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/posix/thread.c
src/posix/thread.c
+6
-4
No files found.
src/posix/thread.c
View file @
63d5e98c
...
...
@@ -994,7 +994,7 @@ struct vlc_timer
void
(
*
func
)
(
void
*
);
void
*
data
;
mtime_t
value
,
interval
;
vlc_atomic_t
overruns
;
atomic_uint
overruns
;
};
VLC_NORETURN
...
...
@@ -1037,7 +1037,8 @@ static void *vlc_timer_thread (void *data)
{
misses
--
;
timer
->
value
+=
misses
*
timer
->
interval
;
vlc_atomic_add
(
&
timer
->
overruns
,
misses
);
atomic_fetch_add_explicit
(
&
timer
->
overruns
,
misses
,
memory_order_relaxed
);
}
}
...
...
@@ -1069,7 +1070,7 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
timer
->
data
=
data
;
timer
->
value
=
0
;
timer
->
interval
=
0
;
vlc_atomic_se
t
(
&
timer
->
overruns
,
0
);
atomic_ini
t
(
&
timer
->
overruns
,
0
);
if
(
vlc_clone
(
&
timer
->
thread
,
vlc_timer_thread
,
timer
,
VLC_THREAD_PRIORITY_INPUT
))
...
...
@@ -1141,7 +1142,8 @@ void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
*/
unsigned
vlc_timer_getoverrun
(
vlc_timer_t
timer
)
{
return
vlc_atomic_swap
(
&
timer
->
overruns
,
0
);
return
atomic_exchange_explicit
(
&
timer
->
overruns
,
0
,
memory_order_relaxed
);
}
...
...
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