From e4a0c352f4ce59bbdffcd621143db70faef23f9b Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Tue, 23 Jan 2024 21:56:31 +0000 Subject: [PATCH] helper_thread: do not send A_EXIT message when exit is called When helper_thread_exit() is called, it uses two means to tell helper_thread_main() to stop. It sends an A_EXIT message via the pipes used for inter-process communication and it also sets the exit flag in struct helper_data. When helper_thread_main() receives the A_EXIT message, it immediately breaks out of its main loop without carrying out any further activity such as recording final log entries. This leads to missing final log entries when log_avg_msec is enabled. Removing the A_EXIT message helps resolve this issue in some cases as with its removal the actions in the body of the loop have an opportunity to be taken before checking the flag in struct helper_data. Signed-off-by: Vincent Fu --- helper_thread.c | 1 - 1 file changed, 1 deletion(-) diff --git a/helper_thread.c b/helper_thread.c index 2a9dabf5..332ccb53 100644 --- a/helper_thread.c +++ b/helper_thread.c @@ -161,7 +161,6 @@ void helper_thread_exit(void) return; helper_data->exit = 1; - submit_action(A_EXIT); pthread_join(helper_data->thread, NULL); } -- 2.25.1