+
+static bool shutdown_agent_management_thread(void *data)
+{
+ struct lttng_pipe *quit_pipe = data;
+ const int write_fd = lttng_pipe_get_writefd(quit_pipe);
+
+ return notify_thread_pipe(write_fd) == 1;
+}
+
+bool launch_agent_registration_thread(void)
+{
+ struct lttng_pipe *quit_pipe;
+ struct lttng_thread *thread;
+
+ quit_pipe = lttng_pipe_open(FD_CLOEXEC);
+ if (!quit_pipe) {
+ goto error;
+ }
+ thread = lttng_thread_create("Agent management",
+ thread_agent_management,
+ shutdown_agent_management_thread,
+ quit_pipe);
+ if (!thread) {
+ goto error;
+ }
+
+ lttng_thread_put(thread);
+ return true;
+error:
+ lttng_pipe_destroy(quit_pipe);
+ return false;
+}