svn commit: r302155 - head/sys/netinet
Bjoern A. Zeeb
bz at FreeBSD.org
Thu Jun 23 21:32:53 UTC 2016
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();
More information about the svn-src-all
mailing list