summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2018-08-10 19:27:13 +0300
committerMax Romanov <max.romanov@nginx.com>2018-08-10 19:27:13 +0300
commit86740ab34b50190d8d6930565b23e8636518281f (patch)
tree643e142bba8e90d572284e1fc0c2f9e1ddaf4d32 /src/nxt_port.c
parent941616f893683a573d681187bdee3dca72eaf119 (diff)
downloadunit-86740ab34b50190d8d6930565b23e8636518281f.tar.gz
unit-86740ab34b50190d8d6930565b23e8636518281f.tar.bz2
Introducing app joint to accurate app release.
For accurate app descriptor release, it is required to count the number of use counts. Use count increased when: - app linked to configuration app queue; - socket conf stores pointer to app; - request for start app process posted to router service thread; Application port has pointer to app, but it does not increase use count to avoid use count loop. Timer needs a pointer to nxt_timer_t which is stored in engine timers tree. nxt_timer_t now resides in nxt_app_joint_t and does not lock the application. Start process port RPC handlers is also linked to nxt_app_joint_t. App joint (nxt_app_joint_t) is a 'weak pointer': - single threaded; - use countable; - store pointer to nxt_app_t (which can be NULL); nxt_app_t has pointer to nxt_app_joint_t and update its pointer to app.
Diffstat (limited to 'src/nxt_port.c')
-rw-r--r--src/nxt_port.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/nxt_port.c b/src/nxt_port.c
index ae08b71d..c4b2af96 100644
--- a/src/nxt_port.c
+++ b/src/nxt_port.c
@@ -109,11 +109,7 @@ nxt_port_release(nxt_task_t *task, nxt_port_t *port)
nxt_debug(task, "port %p %d:%d release, type %d", port, port->pid,
port->id, port->type);
- if (port->app != NULL) {
- nxt_router_app_use(task, port->app, -1);
-
- port->app = NULL;
- }
+ port->app = NULL;
if (port->link.next != NULL) {
nxt_assert(port->process != NULL);