diff options
Diffstat (limited to 'src/gc/env/gcenv.interlocked.inl')
-rw-r--r-- | src/gc/env/gcenv.interlocked.inl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gc/env/gcenv.interlocked.inl b/src/gc/env/gcenv.interlocked.inl index 3eaaa3ae59..1df2700d7f 100644 --- a/src/gc/env/gcenv.interlocked.inl +++ b/src/gc/env/gcenv.interlocked.inl @@ -70,7 +70,7 @@ __forceinline T Interlocked::Exchange(T volatile *destination, T value) static_assert(sizeof(long) == sizeof(T), "Size of long must be the same as size of T"); return _InterlockedExchange((long*)destination, value); #else - T result = __sync_swap(destination, value); + T result = __atomic_exchange_n(destination, value, __ATOMIC_ACQ_REL); ArmInterlockedOperationBarrier(); return result; #endif @@ -164,7 +164,7 @@ __forceinline T Interlocked::ExchangePointer(T volatile * destination, T value) return (T)(TADDR)_InterlockedExchange((long volatile *)(void* volatile *)destination, (long)(void*)value); #endif #else - T result = (T)(TADDR)__sync_swap((void* volatile *)destination, value); + T result = (T)(TADDR)__atomic_exchange_n((void* volatile *)destination, value, __ATOMIC_ACQ_REL); ArmInterlockedOperationBarrier(); return result; #endif @@ -180,7 +180,7 @@ __forceinline T Interlocked::ExchangePointer(T volatile * destination, std::null return (T)(TADDR)_InterlockedExchange((long volatile *)(void* volatile *)destination, (long)(void*)value); #endif #else - T result = (T)(TADDR)__sync_swap((void* volatile *)destination, value); + T result = (T)(TADDR)__atomic_exchange_n((void* volatile *)destination, value, __ATOMIC_ACQ_REL); ArmInterlockedOperationBarrier(); return result; #endif |