mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
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:
parent
112d9aeda1
commit
b9307b7175
@ -987,7 +987,7 @@ void mp_cancel_reset(struct mp_cancel *c)
|
|||||||
// For convenience, c==NULL is allowed.
|
// For convenience, c==NULL is allowed.
|
||||||
bool mp_cancel_test(struct mp_cancel *c)
|
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
|
// Wait until the even is signaled. If the timeout (in seconds) expires, return
|
||||||
|
Loading…
Reference in New Issue
Block a user