diff options
author | Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com> | 2021-07-29 18:01:48 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-10-05 11:19:26 +0900 |
commit | 4fb420dc7aec6e428e6f4a2320ea66c722d20337 (patch) | |
tree | 15d4982a06408a3da43a36bace372fa572f553f0 | |
parent | 0c26f3bceb8494ad8bcc3d39a23b0464712ed385 (diff) | |
download | DLT-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.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()); } |