summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/atomics.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/atomics.h')
-rw-r--r--src/vppinfra/atomics.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vppinfra/atomics.h b/src/vppinfra/atomics.h
index 5444b6df350..1d480af407b 100644
--- a/src/vppinfra/atomics.h
+++ b/src/vppinfra/atomics.h
@@ -37,7 +37,7 @@
#define clib_atomic_cmp_and_swap(addr,old,new) __sync_val_compare_and_swap(addr, old, new)
#define clib_atomic_bool_cmp_and_swap(addr,old,new) __sync_bool_compare_and_swap(addr, old, new)
-#define clib_atomic_test_and_set(a) __sync_lock_test_and_set(a, 1)
+#define clib_atomic_test_and_set(a) __atomic_exchange_n(a, 1, __ATOMIC_ACQUIRE)
#define clib_atomic_release(a) __sync_lock_release(a)
#define clib_atomic_fence_rel() __atomic_thread_fence(__ATOMIC_RELEASE);