From: Mathieu Desnoyers Date: Sat, 9 May 2009 14:48:38 +0000 (-0400) Subject: Add ACCESS_ONCE to _STORE_SHARED X-Git-Tag: v0.1~245 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ad7de003b45b3a7339b90208c321517c2dcbdc3e;p=urcu.git Add ACCESS_ONCE to _STORE_SHARED We assume that the compiler does not reorder _STORE_SHARED across each other and wrt _READ_SHARED. We therefore need to mark this access as volatile. The compiler cannot reorder volatile accesses. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu.h b/urcu.h index 819555e..b43b280 100644 --- a/urcu.h +++ b/urcu.h @@ -87,7 +87,7 @@ */ #define _STORE_SHARED(x, v) \ do { \ - (x) = (v); \ + ACCESS_ONCE(x) = (v); \ } while (0) /*