Wait also for the active TCP threads on shutdown

This commit is contained in:
Jaroslav Kysela 2014-03-24 14:39:54 +01:00
parent da387b48fe
commit 34cf1530ad

View file

@ -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);