Add the sessiond notification-handling subsystem
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 2752e9ff37be7f142a76eebd902a51a530c14217..deb2edf9ba1e5189cd1d9e40934abfc3da1e43ab 100644 (file)
@@ -1855,6 +1855,8 @@ static void *thread_dispatch_ust_registration(void *data)
                .count = 0,
        };
 
+       rcu_register_thread();
+
        health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH);
 
        if (testpoint(sessiond_thread_app_reg_dispatch)) {
@@ -2088,6 +2090,7 @@ error_testpoint:
                ERR("Health error occurred in %s", __func__);
        }
        health_unregister(health_sessiond);
+       rcu_unregister_thread();
        return NULL;
 }
 
@@ -4325,7 +4328,7 @@ error:
        }
 
        lttng_poll_clean(&events);
-
+       stop_threads();
        rcu_unregister_thread();
        return NULL;
 }
@@ -5970,7 +5973,7 @@ int main(int argc, char **argv)
        }
        load_info->path = opt_load_session_path;
 
-       /* Create health-check thread */
+       /* Create health-check thread. */
        ret = pthread_create(&health_thread, default_pthread_attr(),
                        thread_manage_health, (void *) NULL);
        if (ret) {
@@ -6147,6 +6150,12 @@ exit_client:
 exit_health:
 
 exit_init_data:
+       /*
+        * Wait for all pending call_rcu work to complete before tearing
+        * down data structures. call_rcu worker may be trying to
+        * perform lookups in those structures.
+        */
+       rcu_barrier();
        /*
         * sessiond_cleanup() is called when no other thread is running, except
         * the ht_cleanup thread, which is needed to destroy the hash tables.
This page took 0.025178 seconds and 5 git commands to generate.