.count = 0,
};
+ rcu_register_thread();
+
health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH);
if (testpoint(sessiond_thread_app_reg_dispatch)) {
ERR("Health error occurred in %s", __func__);
}
health_unregister(health_sessiond);
+ rcu_unregister_thread();
return NULL;
}
}
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) {
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.