summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-10-04 14:58:47 +0300
committerMax Romanov <max.romanov@nginx.com>2017-10-04 14:58:47 +0300
commit6a64533fa3b96bb64bfde4615e40376d65a292cb (patch)
treea18ed8059158d833290519e1135209747e28af21 /src/nxt_router.h
parent414d508e04d26ebef0e3e1ba4ed518b11d3af1a0 (diff)
downloadunit-6a64533fa3b96bb64bfde4615e40376d65a292cb.tar.gz
unit-6a64533fa3b96bb64bfde4615e40376d65a292cb.tar.bz2
Introducing use counters for port and app. Thread safe port write.
Use counter helps to simplify logic around port and application free. Port 'post' function introduced to simplify post execution of particular function to original port engine's thread. Write message queue is protected by mutex which makes port write operation thread safe.
Diffstat (limited to 'src/nxt_router.h')
-rw-r--r--src/nxt_router.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nxt_router.h b/src/nxt_router.h
index f5c5f7aa..5056021e 100644
--- a/src/nxt_router.h
+++ b/src/nxt_router.h
@@ -87,6 +87,7 @@ struct nxt_app_s {
uint32_t pending_workers;
uint32_t workers;
uint32_t max_workers;
+ uint32_t max_pending_responses;
nxt_msec_t timeout;
@@ -97,6 +98,8 @@ struct nxt_app_s {
nxt_str_t conf;
nxt_app_prepare_msg_t prepare_msg;
+
+ nxt_atomic_t use_count;
};
@@ -141,6 +144,7 @@ void nxt_router_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg);
void nxt_router_conf_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg);
void nxt_router_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg);
-nxt_bool_t nxt_router_app_remove_port(nxt_port_t *port);
+void nxt_router_app_port_close(nxt_task_t *task, nxt_port_t *port);
+void nxt_router_app_use(nxt_task_t *task, nxt_app_t *app, int i);
#endif /* _NXT_ROUTER_H_INCLUDED_ */