X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=9b6f70cd08134acfa45afa1d970735d3d2ee6a4c;hp=d9355b0199cc242d542e781d2ff1808d7b723afb;hb=287a512f2b868c16132b894a8143a5faf0379ca8;hpb=1640c24c73ed9c061d8d148dfa18cfc5fd3b080b diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index d9355b019..9b6f70cd0 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5618,6 +5618,7 @@ int main(int argc, char **argv) struct lttng_pipe *ust32_channel_monitor_pipe = NULL, *ust64_channel_monitor_pipe = NULL, *kernel_channel_monitor_pipe = NULL; + bool notification_thread_running = false; init_kernel_workarounds(); @@ -6129,6 +6130,7 @@ int main(int argc, char **argv) stop_threads(); goto exit_notification; } + notification_thread_running = true; /* Create thread to manage the client socket */ ret = pthread_create(&client_thread, default_pthread_attr(), @@ -6332,17 +6334,19 @@ exit_init_data: * of the active session and channels at the moment of the teardown. */ if (notification_thread_handle) { - notification_thread_command_quit(notification_thread_handle); + if (notification_thread_running) { + notification_thread_command_quit( + notification_thread_handle); + ret = pthread_join(notification_thread, &status); + if (ret) { + errno = ret; + PERROR("pthread_join notification thread"); + retval = -1; + } + } notification_thread_handle_destroy(notification_thread_handle); } - ret = pthread_join(notification_thread, &status); - if (ret) { - errno = ret; - PERROR("pthread_join notification thread"); - retval = -1; - } - rcu_thread_offline(); rcu_unregister_thread();