Date: Thu, 23 Jun 2016 21:32:52 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302155 - head/sys/netinet Message-ID: <201606232132.u5NLWqdj055899@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Thu Jun 23 21:32:52 2016 New Revision: 302155 URL: https://svnweb.freebsd.org/changeset/base/302155 Log: Try to avoid a 2nd conditional by re-writing the loop, pause, and escape clause another time. Submitted by: jhb Approved by: re (gjb) MFC after: 12 days Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jun 23 21:09:07 2016 (r302154) +++ head/sys/netinet/tcp_subr.c Thu Jun 23 21:32:52 2016 (r302155) @@ -738,13 +738,14 @@ tcp_destroy(void *unused __unused) * up, which means, we should be past the tcp_discardcb() calls. * Sleep to let all tcpcb timers really disappear and cleanup. */ - do { + for (;;) { INP_LIST_RLOCK(&V_tcbinfo); n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - if (n != 0) - pause("tcpdes", hz / 10); - } while (n != 0); + if (n == 0) + break; + pause("tcpdes", hz / 10); + } tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606232132.u5NLWqdj055899>