projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
urcu/compiler: Use atomic builtins if configured
[urcu.git]
/
include
/
urcu
/
compiler.h
diff --git
a/include/urcu/compiler.h
b/include/urcu/compiler.h
index 5b994076f47c913b28d636ae6e7262261befe103..48211293417131c6ff73d0d107de84c4284d9589 100644
(file)
--- a/
include/urcu/compiler.h
+++ b/
include/urcu/compiler.h
@@
-15,10
+15,16
@@
# include <type_traits> /* for std::remove_cv */
#endif
# include <type_traits> /* for std::remove_cv */
#endif
+#include <urcu/config.h>
+
#define caa_likely(x) __builtin_expect(!!(x), 1)
#define caa_unlikely(x) __builtin_expect(!!(x), 0)
#define caa_likely(x) __builtin_expect(!!(x), 1)
#define caa_unlikely(x) __builtin_expect(!!(x), 0)
-#define cmm_barrier() __asm__ __volatile__ ("" : : : "memory")
+#ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS
+# define cmm_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST)
+#else
+# define cmm_barrier() __asm__ __volatile__ ("" : : : "memory")
+#endif
/*
* Instruct the compiler to perform only a single access to a variable
/*
* Instruct the compiler to perform only a single access to a variable
This page took
0.022857 seconds
and
4
git commands to generate.