From 34cf1530adf397b36269c0ef12bdcd12bfc232e3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 24 Mar 2014 14:39:54 +0100 Subject: [PATCH] Wait also for the active TCP threads on shutdown --- src/tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tcp.c b/src/tcp.c index a50e7ea4..ee003a19 100644 --- a/src/tcp.c +++ b/src/tcp.c @@ -727,7 +727,8 @@ tcp_server_done(void) tvh_pipe_close(&tcp_server_pipe); tvhpoll_destroy(tcp_server_poll); - assert(LIST_FIRST(&tcp_server_active) == NULL); + while (LIST_FIRST(&tcp_server_active) != NULL) + usleep(20000); pthread_mutex_lock(&global_lock); while ((tsl = LIST_FIRST(&tcp_server_join)) != NULL) { LIST_REMOVE(tsl, jlink);