X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-pointer.c;h=83f0ffdacb388cdc87016a9a10408fe7b712e62d;hb=7dd8417e70a581e78759d067396d7858c7cb5157;hp=da8b1ea7e76d0c702af5adb37f32361597525022;hpb=2ff1db4a7825af40f327413305de6f9955af0e35;p=urcu.git diff --git a/urcu-pointer.c b/urcu-pointer.c index da8b1ea..83f0ffd 100644 --- a/urcu-pointer.c +++ b/urcu-pointer.c @@ -24,6 +24,8 @@ * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ +#include + #include "urcu-pointer-static.h" /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ #include "urcu-pointer.h" @@ -50,5 +52,9 @@ void *rcu_xchg_pointer_sym(void **p, void *v) void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new) { wmb(); - return uatomic_cmpxchg(p, old, _new); + if (likely(URCU_CAS_AVAIL())) + return uatomic_cmpxchg(p, old, _new); + + /* Compatibility for i386. Old-timer. */ + return compat_uatomic_cmpxchg(p, old, _new); }