Store 'new_val' and return the previous value. Implies a Release memory barrier (i.e. the same as Store()).
| 139 | /// Store 'new_val' and return the previous value. Implies a Release memory barrier |
| 140 | /// (i.e. the same as Store()). |
| 141 | ALWAYS_INLINE T* Swap(T* val) { |
| 142 | return reinterpret_cast<T*>(ptr_.Swap(reinterpret_cast<intptr_t>(val))); |
| 143 | } |
| 144 | private: |
| 145 | internal::AtomicInt<intptr_t> ptr_; |
| 146 | }; |