summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>2021-07-29 18:01:48 +0700
committerSaya Sugiura <ssugiura@jp.adit-jv.com>2021-10-05 11:07:01 +0900
commitbaa2e74daa133c42baf08368f86a35ee076c4039 (patch)
tree15d4982a06408a3da43a36bace372fa572f553f0
parent20633b8139f2db293edcae8895c0b7aef4ac013a (diff)
downloadDLT-daemon-baa2e74daa133c42baf08368f86a35ee076c4039.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());
}