+ /*
+ * Starting from here, we can create threads. This needs to be after
+ * lttng_daemonize due to RCU.
+ */
+
+ /*
+ * Initialize the health check subsystem. This call should set the
+ * appropriate time values.
+ */
+ health_sessiond = health_app_create(NR_HEALTH_SESSIOND_TYPES);
+ if (!health_sessiond) {
+ PERROR("health_app_create error");
+ retval = -1;
+ goto exit_health_sessiond_cleanup;
+ }
+
+ if (init_ht_cleanup_quit_pipe()) {
+ retval = -1;
+ goto exit_ht_cleanup_quit_pipe;
+ }
+
+ /* Setup the thread ht_cleanup communication pipe. */
+ if (utils_create_pipe_cloexec(ht_cleanup_pipe)) {
+ retval = -1;
+ goto exit_ht_cleanup_pipe;
+ }
+
+ /* Set up max poll set size */
+ if (lttng_poll_set_max_size()) {
+ retval = -1;
+ goto exit_set_max_size;
+ }
+
+ /* Create thread to clean up RCU hash tables */
+ ret = pthread_create(&ht_cleanup_thread, NULL,
+ thread_ht_cleanup, (void *) NULL);
+ if (ret) {
+ errno = ret;
+ PERROR("pthread_create ht_cleanup");
+ retval = -1;
+ goto exit_ht_cleanup;
+ }
+