Use __atomic_signal_fence(__ATOMIC_SEQ_CST) for cmm_barrier(), so
ThreadSanitizer can understand the memory synchronization.

Signed-off-by: Ondřej Surý <ond...@sury.org>
---
 include/urcu/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/urcu/compiler.h b/include/urcu/compiler.h
index 2f32b38..5763378 100644
--- a/include/urcu/compiler.h
+++ b/include/urcu/compiler.h
@@ -28,7 +28,7 @@
 #define caa_likely(x)  __builtin_expect(!!(x), 1)
 #define caa_unlikely(x)        __builtin_expect(!!(x), 0)
 
-#define        cmm_barrier()   __asm__ __volatile__ ("" : : : "memory")
+#define        cmm_barrier()   __atomic_signal_fence(__ATOMIC_SEQ_CST)
 
 /*
  * Instruct the compiler to perform only a single access to a variable
-- 
2.39.2

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to