X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-pointer-static.h;h=c0533c9d3281af0f613e7490ce18e67594bf75e4;hp=0a01f1ffc944550d3c66cdf9b8d5a53c2a5c8225;hb=0f4ac97ffd64ada974285b893ca1a594a6f003ff;hpb=2b5554c9169ea1ef93dffacb7671a00f9e7de511 diff --git a/urcu-pointer-static.h b/urcu-pointer-static.h index 0a01f1f..c0533c9 100644 --- a/urcu-pointer-static.h +++ b/urcu-pointer-static.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include /** * _rcu_dereference - reads (copy) a RCU-protected pointer to a local variable @@ -78,7 +78,10 @@ if (!__builtin_constant_p(_new) || \ ((_new) != NULL)) \ wmb(); \ - uatomic_cmpxchg(p, _________pold, _________pnew); \ + (likely(URCU_CAS_AVAIL()) ? \ + (uatomic_cmpxchg(p, _________pold, _________pnew)) : \ + (compat_uatomic_cmpxchg(p, _________pold, \ + _________pnew))) \ }) /**