From: Mathieu Desnoyers Date: Thu, 1 Oct 2009 02:28:47 +0000 (-0400) Subject: Fix rcu_assign_pointer() dynamic linking behavior X-Git-Tag: v0.2~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=efafc824ca148c6b2ca7f95dc86d2aaa38d4a923;p=userspace-rcu.git Fix rcu_assign_pointer() dynamic linking behavior Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-qsbr.c b/urcu-qsbr.c index f002c34..bb98a19 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -286,7 +286,7 @@ void *rcu_dereference(void *p) void *rcu_assign_pointer_sym(void **p, void *v) { wmb(); - return STORE_SHARED(p, v); + return STORE_SHARED(*p, v); } void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new) diff --git a/urcu-qsbr.h b/urcu-qsbr.h index fdf4712..6eebdc7 100644 --- a/urcu-qsbr.h +++ b/urcu-qsbr.h @@ -102,7 +102,7 @@ extern void rcu_thread_online(void); extern void *rcu_assign_pointer_sym(void **p, void *v); #define rcu_assign_pointer(p, v) \ - rcu_assign_pointer_sym((void **)(p), (v)) + rcu_assign_pointer_sym((void **)(&(p)), (v)) extern void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new); #define rcu_cmpxchg_pointer(p, old, _new) \ diff --git a/urcu.c b/urcu.c index 7fdb1a6..c13ad63 100644 --- a/urcu.c +++ b/urcu.c @@ -380,7 +380,7 @@ void *rcu_dereference(void *p) void *rcu_assign_pointer_sym(void **p, void *v) { wmb(); - return STORE_SHARED(p, v); + return STORE_SHARED(*p, v); } void *rcu_xchg_pointer_sym(void **p, void *v) diff --git a/urcu.h b/urcu.h index 9d4cd3c..a0aac21 100644 --- a/urcu.h +++ b/urcu.h @@ -74,7 +74,7 @@ extern void *rcu_dereference(void *p); extern void *rcu_assign_pointer_sym(void **p, void *v); #define rcu_assign_pointer(p, v) \ - rcu_assign_pointer_sym((void **)(p), (v)) + rcu_assign_pointer_sym((void **)(&(p)), (v)) extern void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new); #define rcu_cmpxchg_pointer(p, old, _new) \