diff options
author | wm4 <wm4@nowhere> | 2015-03-09 22:35:10 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-09 22:36:17 +0100 |
commit | b9307b71753f205baaac99f8e803774c7efdebeb (patch) | |
tree | a2a7a8f7742f2dccc5119d02d19c70aa236f062e | |
parent | 112d9aeda1f059f22cd4cf0cbb2f489a74ecd9eb (diff) | |
download | mpv-b9307b71753f205baaac99f8e803774c7efdebeb.tar.bz2 mpv-b9307b71753f205baaac99f8e803774c7efdebeb.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.)
-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 |