projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
urcu-defer: handle malloc error value
[urcu.git]
/
urcu-pointer-static.h
diff --git
a/urcu-pointer-static.h
b/urcu-pointer-static.h
index c0533c9d3281af0f613e7490ce18e67594bf75e4..b6444860f51143dca1bb3d5eb34e4bbd4a6ce1cd 100644
(file)
--- a/
urcu-pointer-static.h
+++ b/
urcu-pointer-static.h
@@
-9,7
+9,7
@@
* TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-pointer.h for
* linking dynamically with the userspace rcu library.
*
* 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
* Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
*
* This library is free software; you can redistribute it and/or
@@
-34,6
+34,10
@@
#include <urcu/system.h>
#include <urcu/uatomic_arch.h>
#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
/**
* _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
@@
-45,7
+49,7
@@
* Inserts memory barriers on architectures that require them (currently only
* Alpha) and documents which pointers are protected by RCU.
*
* Inserts memory barriers on architectures that require them (currently only
* Alpha) and documents which pointers are protected by RCU.
*
- * The compiler memory barrier in LOAD_SHARED() ensures that value-speculative
+ * The compiler memory barrier in
CMM_
LOAD_SHARED() ensures that value-speculative
* optimizations (e.g. VSS: Value Speculation Scheduling) does not perform the
* data read before the pointer read by speculating the value of the pointer.
* Correct ordering is ensured because the pointer is read as a volatile access.
* optimizations (e.g. VSS: Value Speculation Scheduling) does not perform the
* data read before the pointer read by speculating the value of the pointer.
* Correct ordering is ensured because the pointer is read as a volatile access.
@@
-58,8
+62,8
@@
*/
#define _rcu_dereference(p) ({ \
*/
#define _rcu_dereference(p) ({ \
- typeof(p) _________p1 = LOAD_SHARED(p); \
-
smp_read_barrier_depends();
\
+ typeof(p) _________p1 =
CMM_
LOAD_SHARED(p); \
+
cmm_smp_read_barrier_depends();
\
(_________p1); \
})
(_________p1); \
})
@@
-77,11
+81,8
@@
typeof(*p) _________pnew = (_new); \
if (!__builtin_constant_p(_new) || \
((_new) != NULL)) \
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)) \
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
-
wmb();
\
+
cmm_wmb();
\
uatomic_xchg(p, _________pv); \
})
uatomic_xchg(p, _________pv); \
})
@@
-105,8
+106,8
@@
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
-
wmb();
\
-
STORE_SHARED(*(p), _________pv);
\
+
cmm_wmb();
\
+
uatomic_set(p, _________pv);
\
})
/**
})
/**
@@
-124,4
+125,8
@@
#define _rcu_assign_pointer(p, v) _rcu_set_pointer(&(p), v)
#define _rcu_assign_pointer(p, v) _rcu_set_pointer(&(p), v)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _URCU_POINTER_STATIC_H */
#endif /* _URCU_POINTER_STATIC_H */
This page took
0.042267 seconds
and
4
git commands to generate.