diff options
author | Chris Robinson <[email protected]> | 2018-11-26 14:31:54 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-26 14:31:54 -0800 |
commit | a6923790fac739f0b98db6c06bc93543b9707556 (patch) | |
tree | e30677dd529ba0a2fecb6cbd6232f862acdc27dd /common/atomic.h | |
parent | 5b2b96b24598636e35f1fe7ecf868b09571065d6 (diff) |
Avoid using ATOMIC_INIT
Diffstat (limited to 'common/atomic.h')
-rw-r--r-- | common/atomic.h | 4 |
1 files changed, 1 insertions, 3 deletions
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<T> -#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<unsigned int>; 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) |