X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=urcu-pointer.h;h=1e1e6bf8a157dff00edcfda519a773b1e0a4a32d;hp=dd64ec4128fadb2f7b39971a0d975c891c0a6013;hb=3daae22a68a6e74c99d39a8c6b628f5c9121c54a;hpb=c7eaf61c307ee909eb2dcebb956e73776f1a0441 diff --git a/urcu-pointer.h b/urcu-pointer.h index dd64ec4..1e1e6bf 100644 --- a/urcu-pointer.h +++ b/urcu-pointer.h @@ -47,9 +47,9 @@ extern "C" { #define rcu_dereference _rcu_dereference /* - * rcu_cmpxchg_pointer(type **ptr, type *new, type *old) + * type *rcu_cmpxchg_pointer(type **ptr, type *new, type *old) * type *rcu_xchg_pointer(type **ptr, type *new) - * type *rcu_set_pointer(type **ptr, type *new) + * void rcu_set_pointer(type **ptr, type *new) * * RCU pointer updates. * @ptr: address of the pointer to modify @@ -94,20 +94,24 @@ extern void *rcu_xchg_pointer_sym(void **p, void *v); (_________p1); \ }) +/* + * Note: rcu_set_pointer_sym returns @v because we don't want to break + * the ABI. At the API level, rcu_set_pointer() now returns void. Use of + * the return value is therefore deprecated, and will cause a build + * error. + */ extern void *rcu_set_pointer_sym(void **p, void *v); #define rcu_set_pointer(p, v) \ - ({ \ + do { \ typeof(*(p)) _________pv = (v); \ - typeof(*(p)) _________p1 = URCU_FORCE_CAST(typeof(*(p)), \ - rcu_set_pointer_sym(URCU_FORCE_CAST(void **, p), \ - _________pv)); \ - (_________p1); \ - }) + (void) rcu_set_pointer_sym(URCU_FORCE_CAST(void **, p), \ + _________pv); \ + } while (0) #endif /* !_LGPL_SOURCE */ /* - * rcu_assign_pointer(type *ptr, type *new) + * void rcu_assign_pointer(type *ptr, type *new) * * Same as rcu_set_pointer, but takes the pointer to assign to rather than its * address as first parameter. Provided for compatibility with the Linux kernel