From 4fb420dc7aec6e428e6f4a2320ea66c722d20337 Mon Sep 17 00:00:00 2001 From: Bui Nguyen Quoc Thanh Date: Thu, 29 Jul 2021 18:01:48 +0700 Subject: client: pthread_join for deinit In case the client sends single request of control there could be a case the dlt_control_init finishes before the cancellation of receiver thread. So the main thread should wait for the receiver thread via pthread_join Signed-off-by: Bui Nguyen Quoc Thanh --- src/console/dlt-control-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/console/dlt-control-common.c b/src/console/dlt-control-common.c index 7e16bde..96a15a2 100644 --- a/src/console/dlt-control-common.c +++ b/src/console/dlt-control-common.c @@ -632,6 +632,7 @@ int dlt_control_deinit(void) { /* Stopping the listener thread */ pthread_cancel(daemon_connect_thread); + pthread_join(daemon_connect_thread, NULL); /* Closing the socket */ return dlt_client_cleanup(&g_client, get_verbosity()); } -- cgit v1.2.1