From b6d8d5e05c461a75238ac95a3faf92a1187e78cb Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 13 Sep 2014 17:08:47 +0200 Subject: [PATCH] stream: fix build with emulated atomics This code was legal with C11 atomics, but it fails with our compatibility wrapper. --- stream/stream.c | 6 +++--- 1 file 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)