From b9307b71753f205baaac99f8e803774c7efdebeb Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 9 Mar 2015 22:35:10 +0100 Subject: 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.) --- stream/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream') 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 -- cgit v1.2.3