Fix: call_rcu: teardown default call_rcu worker on application exit
[urcu.git] / src / urcu.c
index 0877bfc942b7eb168774a9db1ae3181c71e92bf3..c60307e15351241dbb0158b5d48d589852fcca65 100644 (file)
@@ -109,11 +109,13 @@ void rcu_init(void)
 static int init_done;
 
 void __attribute__((constructor)) rcu_init(void);
-void __attribute__((destructor)) rcu_exit(void);
 
 static DEFINE_URCU_TLS(int, rcu_signal_was_blocked);
 #endif
 
+void __attribute__((destructor)) rcu_exit(void);
+static void urcu_call_rcu_exit(void);
+
 /*
  * rcu_gp_lock ensures mutual exclusion between threads calling
  * synchronize_rcu().
@@ -696,20 +698,22 @@ void rcu_init(void)
                urcu_die(errno);
 }
 
+/*
+ * Don't unregister the SIGRCU signal handler anymore, because
+ * call_rcu threads could still be using it shortly before the
+ * application exits.
+ * Assertion disabled because call_rcu threads are now rcu
+ * readers, and left running at exit.
+ * urcu_posix_assert(cds_list_empty(&registry));
+ */
+
+#endif /* #ifdef RCU_SIGNAL */
+
 void rcu_exit(void)
 {
-       /*
-        * Don't unregister the SIGRCU signal handler anymore, because
-        * call_rcu threads could still be using it shortly before the
-        * application exits.
-        * Assertion disabled because call_rcu threads are now rcu
-        * readers, and left running at exit.
-        * urcu_posix_assert(cds_list_empty(&registry));
-        */
+       urcu_call_rcu_exit();
 }
 
-#endif /* #ifdef RCU_SIGNAL */
-
 DEFINE_RCU_FLAVOR(rcu_flavor);
 
 #include "urcu-call-rcu-impl.h"
This page took 0.023199 seconds and 4 git commands to generate.