Rename all memory primitives with prefix cmm_
[urcu.git] / urcu-pointer-static.h
index c0533c9d3281af0f613e7490ce18e67594bf75e4..c8ac7f0c0861a2d80e20e935dddf99303693fa75 100644 (file)
@@ -9,7 +9,7 @@
  * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-pointer.h for
  * linking dynamically with the userspace rcu library.
  *
- * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
  *
  * This library is free software; you can redistribute it and/or
 #include <urcu/system.h>
 #include <urcu/uatomic_arch.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
 /**
  * _rcu_dereference - reads (copy) a RCU-protected pointer to a local variable
  * into a RCU read-side critical section. The pointer can later be safely
@@ -59,7 +63,7 @@
 
 #define _rcu_dereference(p)     ({                                     \
                                typeof(p) _________p1 = LOAD_SHARED(p); \
-                               smp_read_barrier_depends();             \
+                               cmm_smp_read_barrier_depends();         \
                                (_________p1);                          \
                                })
 
                typeof(*p) _________pnew = (_new);                      \
                if (!__builtin_constant_p(_new) ||                      \
                    ((_new) != NULL))                                   \
-                       wmb();                                          \
-               (likely(URCU_CAS_AVAIL()) ?                             \
-                       (uatomic_cmpxchg(p, _________pold, _________pnew)) : \
-                       (compat_uatomic_cmpxchg(p, _________pold,       \
-                                               _________pnew)))        \
+                       cmm_wmb();                                              \
+               uatomic_cmpxchg(p, _________pold, _________pnew);       \
        })
 
 /**
@@ -95,7 +96,7 @@
                typeof(*p) _________pv = (v);           \
                if (!__builtin_constant_p(v) ||         \
                    ((v) != NULL))                      \
-                       wmb();                          \
+                       cmm_wmb();                              \
                uatomic_xchg(p, _________pv);           \
        })
 
                typeof(*p) _________pv = (v);           \
                if (!__builtin_constant_p(v) ||         \
                    ((v) != NULL))                      \
-                       wmb();                          \
-               STORE_SHARED(*(p), _________pv);        \
+                       cmm_wmb();                              \
+               uatomic_set(p, _________pv);            \
        })
 
 /**
 
 #define _rcu_assign_pointer(p, v)      _rcu_set_pointer(&(p), v)
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _URCU_POINTER_STATIC_H */
This page took 0.025082 seconds and 4 git commands to generate.