diff options
author | Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com> | 2021-07-29 18:01:48 +0700 |
---|---|---|
committer | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2021-10-05 11:07:01 +0900 |
commit | baa2e74daa133c42baf08368f86a35ee076c4039 (patch) | |
tree | 15d4982a06408a3da43a36bace372fa572f553f0 | |
parent | 20633b8139f2db293edcae8895c0b7aef4ac013a (diff) | |
download | DLT-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.c | 1 |
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()); } |