diff options
author | Igor Sysoev <igor@sysoev.ru> | 2018-03-29 16:35:38 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2018-03-29 16:35:38 +0300 |
commit | 5a9c23e2b4ff39ee4c25f67ece56e3d441edfeed (patch) | |
tree | 1096801258842d02d9206156ae0fb587be2a8c78 /src/nxt_runtime.c | |
parent | 7205bf4b86cfa662a7267afd7c316118084fc600 (diff) | |
download | unit-5a9c23e2b4ff39ee4c25f67ece56e3d441edfeed.tar.gz unit-5a9c23e2b4ff39ee4c25f67ece56e3d441edfeed.tar.bz2 |
Using nxt_lvlhsh_peek() for port hashes.
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r-- | src/nxt_runtime.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index d4f19dbf..a72bf945 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -1585,8 +1585,7 @@ nxt_runtime_process_new(nxt_runtime_t *rt) static void nxt_runtime_process_destroy(nxt_runtime_t *rt, nxt_process_t *process) { - nxt_port_t *port; - nxt_lvlhsh_each_t lhe; + nxt_port_t *port; nxt_assert(process->use_count == 0); nxt_assert(process->registered == 0); @@ -1594,13 +1593,10 @@ nxt_runtime_process_destroy(nxt_runtime_t *rt, nxt_process_t *process) nxt_port_mmaps_destroy(&process->incoming, 1); nxt_port_mmaps_destroy(&process->outgoing, 1); - port = nxt_port_hash_first(&process->connected_ports, &lhe); - - while(port != NULL) { - nxt_port_hash_remove(&process->connected_ports, port); + do { + port = nxt_port_hash_retrieve(&process->connected_ports); - port = nxt_port_hash_first(&process->connected_ports, &lhe); - } + } while (port != NULL); nxt_thread_mutex_destroy(&process->incoming.mutex); nxt_thread_mutex_destroy(&process->outgoing.mutex); |