X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=include%2Furcu%2Fstatic%2Furcu-pointer.h;h=6e120fc983b128f55c5195403712da292cdc2dad;hp=28333c57746e927bfc44e06e0a9fcc2b0e4794e2;hb=2f10494ace5729ad4c834d57f4960b48b09877f6;hpb=c278ffc739374fbcc6d2fb35eca26b57da4c6447 diff --git a/include/urcu/static/urcu-pointer.h b/include/urcu/static/urcu-pointer.h index 28333c5..6e120fc 100644 --- a/include/urcu/static/urcu-pointer.h +++ b/include/urcu/static/urcu-pointer.h @@ -79,6 +79,8 @@ extern "C" { * using synchronize_rcu(). If fails (unexpected value), returns old (which * should not be freed !). * + * uatomic_cmpxchg() acts as both release and acquire barriers. + * * This macro is less than 10 lines long. The intent is that this macro * meets the 10-line criterion in LGPL, allowing this function to be * expanded directly in non-LGPL code. @@ -88,9 +90,6 @@ extern "C" { ({ \ __typeof__(*p) _________pold = (old); \ __typeof__(*p) _________pnew = (_new); \ - if (!__builtin_constant_p(_new) || \ - ((_new) != NULL)) \ - cmm_wmb(); \ uatomic_cmpxchg(p, _________pold, _________pnew); \ }) @@ -99,6 +98,8 @@ extern "C" { * pointer to the data structure, which can be safely freed after waiting for a * quiescent state using synchronize_rcu(). * + * uatomic_xchg() acts as both release and acquire barriers. + * * This macro is less than 10 lines long. The intent is that this macro * meets the 10-line criterion in LGPL, allowing this function to be * expanded directly in non-LGPL code. @@ -107,9 +108,6 @@ extern "C" { __extension__ \ ({ \ __typeof__(*p) _________pv = (v); \ - if (!__builtin_constant_p(v) || \ - ((v) != NULL)) \ - cmm_wmb(); \ uatomic_xchg(p, _________pv); \ })