diff --git a/BAN/include/BAN/Atomic.h b/BAN/include/BAN/Atomic.h index 62a54e81c0..18b7ac87f5 100644 --- a/BAN/include/BAN/Atomic.h +++ b/BAN/include/BAN/Atomic.h @@ -46,6 +46,7 @@ namespace BAN inline T operator++(int) volatile { return __atomic_fetch_add(&m_value, 1, MEM_ORDER); } inline bool compare_exchange(T expected, T desired, MemoryOrder mem_order = MEM_ORDER) volatile { return __atomic_compare_exchange_n(&m_value, &expected, desired, false, mem_order, mem_order); } + inline T exchange(T desired, MemoryOrder mem_order = MEM_ORDER) volatile { return __atomic_exchange_n(&m_value, desired, mem_order); }; private: T m_value;