aboutsummaryrefslogtreecommitdiffhomepage
path: root/common
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-03-02 19:09:31 +0100
committerGravatar wm4 <wm4@nowhere>2015-03-02 19:09:31 +0100
commit01b87e509c292189acdd96bc7a216b50eafbce9e (patch)
tree16ece6a69e7d2a367775c9d642e51ef302cb3981 /common
parent445b3fbf826dd074b1f2a34cddcd3f126462f0d1 (diff)
msg: use relaxed atomics for log level test
This should be sufficient. If stdatomic.h is not available, we make no difference.
Diffstat (limited to 'common')
-rw-r--r--common/msg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/msg.c b/common/msg.c
index 3092845a02..2ae52a4dda 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -136,8 +136,11 @@ bool mp_msg_test(struct mp_log *log, int lev)
struct mp_log_root *root = log->root;
if (!root || root->mute)
return false;
- if (atomic_load(&log->reload_counter) != atomic_load(&root->reload_counter))
+ if (atomic_load_explicit(&log->reload_counter, memory_order_relaxed) !=
+ atomic_load_explicit(&root->reload_counter, memory_order_relaxed))
+ {
update_loglevel(log);
+ }
return lev <= log->level;
}