projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add extern "C" to support linking userspace RCU library with C++ applications
[urcu.git]
/
urcu-pointer-static.h
diff --git
a/urcu-pointer-static.h
b/urcu-pointer-static.h
index c0533c9d3281af0f613e7490ce18e67594bf75e4..093630a084f84ba7c5917a5621ee3fe1de3af258 100644
(file)
--- a/
urcu-pointer-static.h
+++ b/
urcu-pointer-static.h
@@
-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
@@
-78,10
+82,7
@@
if (!__builtin_constant_p(_new) || \
((_new) != NULL)) \
wmb(); \
if (!__builtin_constant_p(_new) || \
((_new) != NULL)) \
wmb(); \
- (likely(URCU_CAS_AVAIL()) ? \
- (uatomic_cmpxchg(p, _________pold, _________pnew)) : \
- (compat_uatomic_cmpxchg(p, _________pold, \
- _________pnew))) \
+ uatomic_cmpxchg(p, _________pold, _________pnew); \
})
/**
})
/**
@@
-106,7
+107,7
@@
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
wmb(); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
wmb(); \
-
STORE_SHARED(*(p), _________pv);
\
+
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.023954 seconds
and
4
git commands to generate.