urcu,call_rcu: avoid create call_rcu_data for child when unneed
[urcu.git] / urcu-call-rcu-impl.h
index d5b75c076de22de777244cc26fb86f0791f898a5..d964c474156473c43b6bbff4f69abf5d06355e57 100644 (file)
@@ -677,6 +677,10 @@ void call_rcu_after_fork_child(void)
        /* Release the mutex. */
        call_rcu_unlock(&call_rcu_mutex);
 
+       /* Do nothing when call_rcu() has not been used */
+       if (cds_list_empty(&call_rcu_data_list))
+               return;
+
        /*
         * Allocate a new default call_rcu_data structure in order
         * to get a working call_rcu thread to go with it.
This page took 0.022653 seconds and 4 git commands to generate.