From 6d82de811f5854eca2d04c3fcb57dc0da3719778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 20 Sep 2018 09:54:34 +0300 Subject: [PATCH] Relax Average value access memory ordering As there are no requirements with regards to the visibility of writes to the Average, the access can be relaxed. --- maxutils/maxbase/include/maxbase/average.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maxutils/maxbase/include/maxbase/average.hh b/maxutils/maxbase/include/maxbase/average.hh index eeae24572..626fe94dd 100644 --- a/maxutils/maxbase/include/maxbase/average.hh +++ b/maxutils/maxbase/include/maxbase/average.hh @@ -210,7 +210,7 @@ public: */ uint8_t value() const { - return mxb::atomic::load(&m_value); + return mxb::atomic::load(&m_value, mxb::atomic::RELAXED); } protected: @@ -220,7 +220,7 @@ protected: protected: void set_value(uint32_t value) { - mxb::atomic::store(&m_value, value); + mxb::atomic::store(&m_value, value, mxb::atomic::RELAXED); } };