helper_thread: do not send A_EXIT message when exit is called
authorVincent Fu <vincent.fu@samsung.com>
Tue, 23 Jan 2024 21:56:31 +0000 (21:56 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Tue, 13 Feb 2024 16:44:43 +0000 (11:44 -0500)
commite4a0c352f4ce59bbdffcd621143db70faef23f9b
treef5e790fe78a73cbc82b1be13792fb28d96fc81a9
parentd09dcd34db7bdff65bb31d4055f5823898d9e629
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 <vincent.fu@samsung.com>
helper_thread.c