diff options
author | wm4 <wm4@nowhere> | 2014-09-13 17:08:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-13 17:08:47 +0200 |
commit | b6d8d5e05c461a75238ac95a3faf92a1187e78cb (patch) | |
tree | 4371dc3101f8b3e894e385e01258567ad98c418f /stream | |
parent | b799bf0dbf0382cb79727cbc4bf9e1ee0a6e6a1d (diff) | |
download | mpv-b6d8d5e05c461a75238ac95a3faf92a1187e78cb.tar.bz2 mpv-b6d8d5e05c461a75238ac95a3faf92a1187e78cb.tar.xz |
stream: fix build with emulated atomics
This code was legal with C11 atomics, but it fails with our
compatibility wrapper.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream.c b/stream/stream.c index a8162ffcb3..7d8dc7d64d 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -1000,20 +1000,20 @@ struct mp_cancel *mp_cancel_new(void *talloc_ctx) // Request abort. void mp_cancel_trigger(struct mp_cancel *c) { - c->triggered = true; + atomic_store(&c->triggered, true); } // Restore original state. (Allows reusing a mp_cancel.) void mp_cancel_reset(struct mp_cancel *c) { - c->triggered = false; + atomic_store(&c->triggered, false); } // Return whether the caller should abort. // For convenience, c==NULL is allowed. bool mp_cancel_test(struct mp_cancel *c) { - return c ? c->triggered : false; + return c ? atomic_load(&c->triggered) : false; } void stream_print_proto_list(struct mp_log *log) |