diff --git a/core/safe_refcount.h b/core/safe_refcount.h index fbafbe2f585..593c2d86e04 100644 --- a/core/safe_refcount.h +++ b/core/safe_refcount.h @@ -113,7 +113,7 @@ public: if (tmp >= p_value) { return tmp; // already greater, or equal } - if (value.compare_exchange_weak(tmp, p_value, std::memory_order_release)) { + if (value.compare_exchange_weak(tmp, p_value, std::memory_order_acq_rel)) { return p_value; } } @@ -125,7 +125,7 @@ public: if (c == 0) { return 0; } - if (value.compare_exchange_weak(c, c + 1, std::memory_order_release)) { + if (value.compare_exchange_weak(c, c + 1, std::memory_order_acq_rel)) { return c + 1; } }