X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-pointer-static.h;h=983d0d5bf429248be1905cfcce8d1e81a9dcaf9d;hp=c0533c9d3281af0f613e7490ce18e67594bf75e4;hb=3d02c34dba0edc4a3554a3862a2ae96d77b3b4e8;hpb=e156285068a631eaafa643d9e930b31780468d00 diff --git a/urcu-pointer-static.h b/urcu-pointer-static.h index c0533c9..983d0d5 100644 --- a/urcu-pointer-static.h +++ b/urcu-pointer-static.h @@ -9,7 +9,7 @@ * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-pointer.h for * linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers + * Copyright (c) 2009 Mathieu Desnoyers * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. * * This library is free software; you can redistribute it and/or @@ -34,6 +34,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * _rcu_dereference - reads (copy) a RCU-protected pointer to a local variable * into a RCU read-side critical section. The pointer can later be safely @@ -78,10 +82,7 @@ if (!__builtin_constant_p(_new) || \ ((_new) != NULL)) \ wmb(); \ - (likely(URCU_CAS_AVAIL()) ? \ - (uatomic_cmpxchg(p, _________pold, _________pnew)) : \ - (compat_uatomic_cmpxchg(p, _________pold, \ - _________pnew))) \ + uatomic_cmpxchg(p, _________pold, _________pnew); \ }) /** @@ -106,7 +107,7 @@ if (!__builtin_constant_p(v) || \ ((v) != NULL)) \ wmb(); \ - STORE_SHARED(*(p), _________pv); \ + uatomic_set(p, _________pv); \ }) /** @@ -124,4 +125,8 @@ #define _rcu_assign_pointer(p, v) _rcu_set_pointer(&(p), v) +#ifdef __cplusplus +} +#endif + #endif /* _URCU_POINTER_STATIC_H */