X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr-static.h;h=147eb18b94357ee885216d3db65f252d54143944;hb=42a3f1f99827c1bd73270966d4fffd6157809a7c;hp=125301f9b7749c4a93784068eb3f6e320aa156d9;hpb=92cb20a84557a365cabcde63cb19809a7cbb2651;p=urcu.git diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h index 125301f..147eb18 100644 --- a/urcu-qsbr-static.h +++ b/urcu-qsbr-static.h @@ -9,7 +9,7 @@ * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-qsbr.h for linking * dynamically with the userspace rcu QSBR 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 @@ -155,15 +155,6 @@ 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); -} -#else /* !(BITS_PER_LONG < 64) */ static inline int rcu_gp_ongoing(unsigned long *ctr) { unsigned long v; @@ -171,7 +162,6 @@ static inline int rcu_gp_ongoing(unsigned long *ctr) v = LOAD_SHARED(*ctr); return v && (v != rcu_gp_ctr); } -#endif /* !(BITS_PER_LONG < 64) */ static inline void _rcu_read_lock(void) { @@ -197,10 +187,12 @@ static inline void _rcu_thread_offline(void) STORE_SHARED(rcu_reader.ctr, 0); smp_mb(); /* write rcu_reader.ctr before read futex */ wake_up_gp(); + barrier(); /* Ensure the compiler does not reorder us with mutex */ } static inline void _rcu_thread_online(void) { + barrier(); /* Ensure the compiler does not reorder us with mutex */ _STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr)); smp_mb(); }