diff options
author | bz <bz@FreeBSD.org> | 2016-06-23 21:32:52 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2016-06-23 21:32:52 +0000 |
commit | 179026d7fde64374122b1e30a2be3b7c4d8ddb8a (patch) | |
tree | fedbc5a2bb4decd2fd0f4e7d445a9eb0e3da0ea3 /sys/netinet/tcp_subr.c | |
parent | fc1dc2df0e7989a34e390c9765b112587ffd5d51 (diff) | |
download | FreeBSD-src-179026d7fde64374122b1e30a2be3b7c4d8ddb8a.zip FreeBSD-src-179026d7fde64374122b1e30a2be3b7c4d8ddb8a.tar.gz |
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
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index cb5a0f1..8764b38 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -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(); |