+ struct thread_state *thread_state = data;
+
+ if (!data) {
+ return;
+ }
+
+ lttng_pipe_destroy(thread_state->quit_pipe);
+ free(thread_state);
+}
+
+static void set_thread_status(struct thread_state *thread_state, bool running)
+{
+ DBG("Marking application registration thread's state as %s", running ? "running" : "error");
+ thread_state->running = running;
+ sem_post(&thread_state->ready);
+}
+
+static bool wait_thread_status(struct thread_state *thread_state)
+{
+ DBG("Waiting for application registration thread to be ready");
+ sem_wait(&thread_state->ready);
+ if (thread_state->running) {
+ DBG("Application registration thread is ready");
+ } else {
+ ERR("Initialization of application registration thread failed");
+ }
+
+ return thread_state->running;
+}
+
+static void thread_init_cleanup(void *data)
+{
+ struct thread_state *thread_state = data;