X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr-static.h;h=86f0fc507449451d70f276571d3c6aa1be61d98a;hb=c53cf27f54bfb914e874ddb82a54653b6ccee276;hp=9f3a9b99f3c36ded7961cdeb3eadc102bba0f51d;hpb=e26fa029fb2db4c2f3746a3bfe46e9a0eeeb41a7;p=urcu.git diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h index 9f3a9b9..86f0fc5 100644 --- a/urcu-qsbr-static.h +++ b/urcu-qsbr-static.h @@ -135,7 +135,7 @@ struct rcu_reader { /* Data used by both reader and synchronize_rcu() */ unsigned long ctr; /* Data used for registry */ - struct list_head head __attribute__((aligned(CACHE_LINE_SIZE))); + struct list_head node __attribute__((aligned(CACHE_LINE_SIZE))); pthread_t tid; }; @@ -155,23 +155,13 @@ static inline void wake_up_gp(void) } } -#if (BITS_PER_LONG < 64) static inline int rcu_gp_ongoing(unsigned long *ctr) { unsigned long v; v = LOAD_SHARED(*ctr); - return v && ((v ^ rcu_gp_ctr) & RCU_GP_CTR); + return v && (v != rcu_gp_ctr); } -#else /* !(BITS_PER_LONG < 64) */ -static inline int rcu_gp_ongoing(unsigned long *ctr) -{ - unsigned long v; - - v = LOAD_SHARED(*ctr); - return v && (v - rcu_gp_ctr > ULONG_MAX / 2); -} -#endif /* !(BITS_PER_LONG < 64) */ static inline void _rcu_read_lock(void) {