summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-09-18 18:38:49 +0200
committerDavid Lamparter <equinox@diac24.net>2019-04-18 12:44:29 +0200
commit4cab68a20d81e95ef697a74b1a62e64d3f8b348f (patch)
treeea7a72634321a94cf7824d1fe2dce495006e55f7
parent.gitignore: ignore core dumps (diff)
downloadfrr-4cab68a20d81e95ef697a74b1a62e64d3f8b348f.tar.xz
frr-4cab68a20d81e95ef697a74b1a62e64d3f8b348f.zip
lib: add cmpxchg_strong to frratomic.h
Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r--lib/frratomic.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/frratomic.h b/lib/frratomic.h
index e86030f83..1e28253f2 100644
--- a/lib/frratomic.h
+++ b/lib/frratomic.h
@@ -80,6 +80,9 @@ typedef std::atomic<uint_fast32_t> atomic_uint_fast32_t;
#define atomic_compare_exchange_weak_explicit(atom, expect, desire, mem1, \
mem2) \
__atomic_compare_exchange_n(atom, expect, desire, 1, mem1, mem2)
+#define atomic_compare_exchange_strong_explicit(atom, expect, desire, mem1, \
+ mem2) \
+ __atomic_compare_exchange_n(atom, expect, desire, 0, mem1, mem2)
/* gcc 4.1 and newer,
* clang 3.3 (possibly older)
@@ -152,7 +155,7 @@ typedef std::atomic<uint_fast32_t> atomic_uint_fast32_t;
rval; \
})
-#define atomic_compare_exchange_weak_explicit(atom, expect, desire, mem1, \
+#define atomic_compare_exchange_strong_explicit(atom, expect, desire, mem1, \
mem2) \
({ \
typeof(atom) _atom = (atom); \
@@ -166,6 +169,8 @@ typedef std::atomic<uint_fast32_t> atomic_uint_fast32_t;
*_expect = rval; \
ret; \
})
+#define atomic_compare_exchange_weak_explicit \
+ atomic_compare_exchange_strong_explicit
#define atomic_fetch_and_explicit(ptr, val, mem) \
({ \