summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-10-28 00:01:46 +0300
committerMax Romanov <max.romanov@nginx.com>2020-10-28 00:01:46 +0300
commita5508cec7a55fe04ab66451c7510fab0e0d4577c (patch)
tree1bc3aac4a484ed5505c90fba1a3a9587a0649f17 /src/nxt_unit.c
parent28ab1de364d048a4cb3f92179adebdd1eb851d65 (diff)
downloadunit-a5508cec7a55fe04ab66451c7510fab0e0d4577c.tar.gz
unit-a5508cec7a55fe04ab66451c7510fab0e0d4577c.tar.bz2
Libunit: added a function to discern main and worker contexts.
Diffstat (limited to '')
-rw-r--r--src/nxt_unit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index 4b0f5230..6a0657c6 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -4855,6 +4855,17 @@ nxt_unit_run_shared(nxt_unit_ctx_t *ctx)
int
+nxt_unit_is_main_ctx(nxt_unit_ctx_t *ctx)
+{
+ nxt_unit_impl_t *lib;
+
+ lib = nxt_container_of(ctx->unit, nxt_unit_impl_t, unit);
+
+ return (ctx == &lib->main_ctx.ctx);
+}
+
+
+int
nxt_unit_process_port_msg(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port)
{
int rc;