RCU dereference check if within read-side critical section
[userspace-rcu.git] / urcu / static / urcu-bp.h
index b6d5f132778380c57af501307cf25e017c92c8ec..0bdefff2b15de3339806e4e3df7cb2117148a651 100644 (file)
@@ -39,6 +39,7 @@
 #include <urcu/uatomic.h>
 #include <urcu/list.h>
 #include <urcu/tls-compat.h>
+#include <urcu/urcu-checker.h>
 
 /*
  * This code section can only be included in LGPL 2.1 compatible source code.
@@ -155,6 +156,7 @@ static inline void _rcu_read_lock(void)
 {
        unsigned long tmp;
 
+       rcu_read_lock_debug();
        if (caa_unlikely(!URCU_TLS(rcu_reader)))
                rcu_bp_register(); /* If not yet registered. */
        cmm_barrier();  /* Ensure the compiler does not reorder us with mutex */
@@ -175,6 +177,7 @@ static inline void _rcu_read_unlock(void)
        cmm_smp_mb();
        _CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, URCU_TLS(rcu_reader)->ctr - RCU_GP_COUNT);
        cmm_barrier();  /* Ensure the compiler does not reorder us with mutex */
+       rcu_read_unlock_debug();
 }
 
 /*
This page took 0.022933 seconds and 4 git commands to generate.