From 99611076d23e7fea0f639f6b46d71b6726da7d93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 23 Apr 2018 15:45:12 -0400 Subject: [PATCH] Cleanup: misleading variable name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Using "running" implies that the thread is guaranteed to be functional/ready. The intention of those "running" flags is only to indicate that the underlying pthread was created. The thread may not be running anymore and these flags should not be used to check if the thread is "ready" to process anything. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index a4f9763eb..e0195a5db 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5717,9 +5717,9 @@ 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; - bool rotation_thread_running = false; - bool timer_thread_running = false; + bool notification_thread_launched = false; + bool rotation_thread_launched = false; + bool timer_thread_launched = false; struct lttng_pipe *ust32_channel_rotate_pipe = NULL, *ust64_channel_rotate_pipe = NULL, *kernel_channel_rotate_pipe = NULL; @@ -6154,7 +6154,7 @@ int main(int argc, char **argv) stop_threads(); goto exit_notification; } - notification_thread_running = true; + notification_thread_launched = true; /* Create timer thread. */ ret = pthread_create(&timer_thread, default_pthread_attr(), @@ -6166,7 +6166,7 @@ int main(int argc, char **argv) stop_threads(); goto exit_notification; } - timer_thread_running = true; + timer_thread_launched = true; /* rotation_thread_data acquires the pipes' read side. */ rotation_thread_handle = rotation_thread_handle_create( @@ -6194,7 +6194,7 @@ int main(int argc, char **argv) stop_threads(); goto exit_rotation; } - rotation_thread_running = true; + rotation_thread_launched = true; /* Create thread to manage the client socket */ ret = pthread_create(&client_thread, default_pthread_attr(), @@ -6400,7 +6400,7 @@ exit_init_data: * of the active session and channels at the moment of the teardown. */ if (notification_thread_handle) { - if (notification_thread_running) { + if (notification_thread_launched) { notification_thread_command_quit( notification_thread_handle); ret = pthread_join(notification_thread, &status); @@ -6414,7 +6414,7 @@ exit_init_data: } if (rotation_thread_handle) { - if (rotation_thread_running) { + if (rotation_thread_launched) { ret = pthread_join(rotation_thread, &status); if (ret) { errno = ret; @@ -6425,7 +6425,7 @@ exit_init_data: rotation_thread_handle_destroy(rotation_thread_handle); } - if (timer_thread_running) { + if (timer_thread_launched) { kill(getpid(), LTTNG_SESSIOND_SIG_EXIT); ret = pthread_join(timer_thread, &status); if (ret) { -- 2.34.1