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.)
This commit is contained in:
wm4 2015-03-09 22:35:10 +01:00
parent 112d9aeda1
commit b9307b7175
1 changed files with 1 additions and 1 deletions

View File

@ -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