summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>2021-07-29 18:01:48 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-10-05 11:19:26 +0900
commit4fb420dc7aec6e428e6f4a2320ea66c722d20337 (patch)
tree15d4982a06408a3da43a36bace372fa572f553f0
parent0c26f3bceb8494ad8bcc3d39a23b0464712ed385 (diff)
downloadDLT-daemon-4fb420dc7aec6e428e6f4a2320ea66c722d20337.tar.gz
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 <thanh.buinguyenquoc@vn.bosch.com>
-rw-r--r--src/console/dlt-control-common.c1
1 files changed, 1 insertions, 0 deletions
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());
}