diff --git a/dist/tunnel-0.1.0b.tar.gz b/dist/tunnel-0.1.0b.tar.gz index d9f1b2c..b718263 100644 Binary files a/dist/tunnel-0.1.0b.tar.gz and b/dist/tunnel-0.1.0b.tar.gz differ diff --git a/tunnel.c b/tunnel.c index 1e1235b..910f8dc 100644 --- a/tunnel.c +++ b/tunnel.c @@ -769,10 +769,13 @@ void destroy() (void)snprintf(path, BUFFLEN, "%s/%s/%s", __plugin__.tmpdir, SOCK_DIR_NAME, HOT_LINE_SOCKET); (void)unlink(path); } - pthread_mutex_unlock(&g_tunnel.lock); + pthread_cancel(g_tunnel.tid); + LOG("Joining tunnel thread"); (void)pthread_join(g_tunnel.tid, NULL); + pthread_mutex_unlock(&g_tunnel.lock); bst_free(g_tunnel.channels); pthread_mutex_destroy(&g_tunnel.lock); + LOG("Antd tunnel is destroyed"); } } static void process_client_message(antd_tunnel_msg_t *msg, antd_client_t *client)