diff options
author | wm4 <wm4@nowhere> | 2015-03-09 22:35:10 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-03-11 12:49:40 +0900 |
commit | b414d9a9a7ae41a247ce5e33027112be398df895 (patch) | |
tree | 4bf6918a9ba3bba4be5fe143d2154f392a719460 | |
parent | 2b737f8bfcd9cd9a555d15296bcd753e53e893d0 (diff) | |
download | mpv-b414d9a9a7ae41a247ce5e33027112be398df895.tar.bz2 mpv-b414d9a9a7ae41a247ce5e33027112be398df895.tar.xz |
stream: use relaxed atomic loads for checking playback aborts
Seems appropriate, and will probably avoid performance surprises with
scary architectures which don't have trivial implementations for atomic
loads. (Consider that demux_mkv calls this very often now, and
libavformat demuxers and streams did this for a while now.)
(cherry picked from commit b9307b71753f205baaac99f8e803774c7efdebeb)
-rw-r--r-- | stream/stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/stream.c b/stream/stream.c index 91f430f1e6..825d7a1292 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -987,7 +987,7 @@ void mp_cancel_reset(struct mp_cancel *c) // For convenience, c==NULL is allowed. bool mp_cancel_test(struct mp_cancel *c) { - return c ? atomic_load(&c->triggered) : false; + return c ? atomic_load_explicit(&c->triggered, memory_order_relaxed) : false; } // Wait until the even is signaled. If the timeout (in seconds) expires, return |