nxt_runtime.c (593:ef19a2b0f508) nxt_runtime.c (597:e6586cced0ab)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 1571 unchanged lines hidden (view full) ---

1580
1581 return process;
1582}
1583
1584
1585static void
1586nxt_runtime_process_destroy(nxt_runtime_t *rt, nxt_process_t *process)
1587{
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 1571 unchanged lines hidden (view full) ---

1580
1581 return process;
1582}
1583
1584
1585static void
1586nxt_runtime_process_destroy(nxt_runtime_t *rt, nxt_process_t *process)
1587{
1588 nxt_port_t *port;
1589 nxt_lvlhsh_each_t lhe;
1588 nxt_port_t *port;
1590
1591 nxt_assert(process->use_count == 0);
1592 nxt_assert(process->registered == 0);
1593
1594 nxt_port_mmaps_destroy(&process->incoming, 1);
1595 nxt_port_mmaps_destroy(&process->outgoing, 1);
1596
1589
1590 nxt_assert(process->use_count == 0);
1591 nxt_assert(process->registered == 0);
1592
1593 nxt_port_mmaps_destroy(&process->incoming, 1);
1594 nxt_port_mmaps_destroy(&process->outgoing, 1);
1595
1597 port = nxt_port_hash_first(&process->connected_ports, &lhe);
1596 do {
1597 port = nxt_port_hash_retrieve(&process->connected_ports);
1598
1598
1599 while(port != NULL) {
1600 nxt_port_hash_remove(&process->connected_ports, port);
1599 } while (port != NULL);
1601
1600
1602 port = nxt_port_hash_first(&process->connected_ports, &lhe);
1603 }
1604
1605 nxt_thread_mutex_destroy(&process->incoming.mutex);
1606 nxt_thread_mutex_destroy(&process->outgoing.mutex);
1607 nxt_thread_mutex_destroy(&process->cp_mutex);
1608
1609 nxt_mp_free(rt->mem_pool, process);
1610}
1611
1612

--- 284 unchanged lines hidden ---
1601 nxt_thread_mutex_destroy(&process->incoming.mutex);
1602 nxt_thread_mutex_destroy(&process->outgoing.mutex);
1603 nxt_thread_mutex_destroy(&process->cp_mutex);
1604
1605 nxt_mp_free(rt->mem_pool, process);
1606}
1607
1608

--- 284 unchanged lines hidden ---