From: Stephen Hemminger Date: Thu, 19 Aug 2021 02:38:19 +0000 (-0700) Subject: telemetry: detach threads X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=71ecc415c5c5c746c89472f30fb4b63b9c968ac3;p=dpdk.git telemetry: detach threads There are a number telemetry threads which are created and there is nothing that does pthread_join() to wait for them. Mark these threads as detached, so that the pthread library can cleanup state when the thread exits. Signed-off-by: Stephen Hemminger Acked-by: Ciara Power --- diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index 8304fbf6e9..48f4c7ba46 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -526,6 +526,7 @@ telemetry_legacy_init(void) pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset); set_thread_name(t_old, "telemetry-v1"); TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n"); + pthread_detach(t_old); return 0; } @@ -564,6 +565,7 @@ telemetry_v2_init(void) } pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset); set_thread_name(t_new, "telemetry-v2"); + pthread_detach(t_new); atexit(unlink_sockets); return 0; diff --git a/lib/telemetry/telemetry_legacy.c b/lib/telemetry/telemetry_legacy.c index b7cd1bdd6c..8aba44d689 100644 --- a/lib/telemetry/telemetry_legacy.c +++ b/lib/telemetry/telemetry_legacy.c @@ -121,6 +121,7 @@ register_client(const char *cmd __rte_unused, const char *params, close(fd); return -1; } + pthread_detach(th); #endif /* !RTE_EXEC_ENV_WINDOWS */ return 0; }