[vlc-commits] vout: relax statistics ordering
Rémi Denis-Courmont
git at videolan.org
Sun Jul 1 11:22:10 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 1 12:15:43 2018 +0300| [794c2e647aa357d7bb90141de63d921cfc71644b] | committer: Rémi Denis-Courmont
vout: relax statistics ordering
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=794c2e647aa357d7bb90141de63d921cfc71644b
---
src/video_output/statistic.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/video_output/statistic.h b/src/video_output/statistic.h
index 5f555fc563..5de40f8234 100644
--- a/src/video_output/statistic.h
+++ b/src/video_output/statistic.h
@@ -48,19 +48,21 @@ static inline void vout_statistic_GetReset(vout_statistic_t *stat,
unsigned *restrict displayed,
unsigned *restrict lost)
{
- *displayed = atomic_exchange(&stat->displayed, 0);
- *lost = atomic_exchange(&stat->lost, 0);
+ *displayed = atomic_exchange_explicit(&stat->displayed, 0,
+ memory_order_relaxed);
+ *lost = atomic_exchange_explicit(&stat->lost, 0, memory_order_relaxed);
}
static inline void vout_statistic_AddDisplayed(vout_statistic_t *stat,
int displayed)
{
- atomic_fetch_add(&stat->displayed, displayed);
+ atomic_fetch_add_explicit(&stat->displayed, displayed,
+ memory_order_relaxed);
}
static inline void vout_statistic_AddLost(vout_statistic_t *stat, int lost)
{
- atomic_fetch_add(&stat->lost, lost);
+ atomic_fetch_add_explicit(&stat->lost, lost, memory_order_relaxed);
}
#endif
More information about the vlc-commits
mailing list