summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSirshak Das <sirshak.das@arm.com>2019-05-28 08:46:27 -0500
committerDamjan Marion <dmarion@me.com>2019-06-05 13:52:01 +0000
commit21aed5cc995148047e80a48f436d12bca7b0073a (patch)
treed443cff671bd121d1799a08b7dc4f210483052ee /src
parent3bb6540ab531f5474217f5f1f7cb7b8dce1d4e57 (diff)
Switch atomic release API from __sync to __atomic builtin.
__sync_lock_release switched to __atomic_store for code consitency, although both generate same instructions with current compilers. Change-Id: I37d320509e43a4c2b8a49af6346dc4a43ca2f535 Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Diffstat (limited to 'src')
-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 1d480af407b..df8e534b683 100644
--- a/src/vppinfra/atomics.h
+++ b/src/vppinfra/atomics.h
@@ -38,7 +38,7 @@
#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) __atomic_exchange_n(a, 1, __ATOMIC_ACQUIRE)
-#define clib_atomic_release(a) __sync_lock_release(a)
+#define clib_atomic_release(a) __atomic_store_n(a, 0, __ATOMIC_RELEASE)
#define clib_atomic_fence_rel() __atomic_thread_fence(__ATOMIC_RELEASE);