- debug_yield_read();
- tmp = urcu_active_readers;
- debug_yield_read();
- /* urcu_gp_ctr = RCU_GP_COUNT | (~RCU_GP_CTR_BIT or RCU_GP_CTR_BIT) */
- if (likely(!(tmp & RCU_GP_CTR_NEST_MASK)))
- urcu_active_readers = urcu_gp_ctr;
- else
- urcu_active_readers = tmp + RCU_GP_COUNT;
- debug_yield_read();
- /*
- * Increment active readers count before accessing the pointer.
- * See force_mb_all_threads().
- */
- barrier();
- debug_yield_read();
-}
-
-static inline void rcu_read_unlock(void)
-{
- debug_yield_read();
- barrier();
- debug_yield_read();
- /*
- * Finish using rcu before decrementing the pointer.
- * See force_mb_all_threads().
- */
- urcu_active_readers -= RCU_GP_COUNT;
- debug_yield_read();
-}
-
-/**
- * rcu_assign_pointer - assign (publicize) a pointer to a newly
- * initialized structure that will be dereferenced by RCU read-side
- * critical sections. Returns the value assigned.
- *
- * Inserts memory barriers on architectures that require them
- * (pretty much all of them other than x86), and also prevents
- * the compiler from reordering the code that initializes the
- * structure after the pointer assignment. More importantly, this
- * call documents which pointers will be dereferenced by RCU read-side
- * code.