From a6923790fac739f0b98db6c06bc93543b9707556 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 26 Nov 2018 14:31:54 -0800 Subject: Avoid using ATOMIC_INIT --- common/atomic.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'common/atomic.h') diff --git a/common/atomic.h b/common/atomic.h index 87560e3d..eaae8fb8 100644 --- a/common/atomic.h +++ b/common/atomic.h @@ -14,8 +14,6 @@ #define ATOMIC(T) std::atomic -#define ATOMIC_INIT std::atomic_init - #define ATOMIC_LOAD std::atomic_load_explicit #define ATOMIC_STORE std::atomic_store_explicit @@ -33,7 +31,7 @@ using RefCount = std::atomic; inline void InitRef(RefCount *ptr, unsigned int value) -{ ATOMIC_INIT(ptr, value); } +{ ptr->store(value, std::memory_order_relaxed); } inline unsigned int ReadRef(RefCount *ptr) { return ptr->load(std::memory_order_acquire); } inline unsigned int IncrementRef(RefCount *ptr) -- cgit v1.2.3