From: Jaroslav Kysela Date: Mon, 24 Mar 2014 13:39:54 +0000 (+0100) Subject: Wait also for the active TCP threads on shutdown X-Git-Tag: v4.1~2199^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F361%2Fhead;p=thirdparty%2Ftvheadend.git Wait also for the active TCP threads on shutdown --- diff --git a/src/tcp.c b/src/tcp.c index a50e7ea4b..ee003a193 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);