nxt_ruby.c (1910:b9e844d85f21) nxt_ruby.c (1980:43553aa72111)
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

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

352 goto fail;
353 }
354
355 rc = nxt_ruby_init_threads(c);
356 if (nxt_slow_path(rc == NXT_UNIT_ERROR)) {
357 goto fail;
358 }
359
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

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

352 goto fail;
353 }
354
355 rc = nxt_ruby_init_threads(c);
356 if (nxt_slow_path(rc == NXT_UNIT_ERROR)) {
357 goto fail;
358 }
359
360 nxt_unit_default_init(task, &ruby_unit_init);
360 nxt_unit_default_init(task, &ruby_unit_init, conf);
361
362 ruby_unit_init.callbacks.request_handler = nxt_ruby_request_handler;
363 ruby_unit_init.callbacks.ready_handler = nxt_ruby_ready_handler;
361
362 ruby_unit_init.callbacks.request_handler = nxt_ruby_request_handler;
363 ruby_unit_init.callbacks.ready_handler = nxt_ruby_ready_handler;
364 ruby_unit_init.shm_limit = conf->shm_limit;
365 ruby_unit_init.data = c;
366 ruby_unit_init.ctx_data = &ruby_ctx;
367
368 unit_ctx = nxt_unit_init(&ruby_unit_init);
369 if (nxt_slow_path(unit_ctx == NULL)) {
370 goto fail;
371 }
372

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

1253static int
1254nxt_ruby_ready_handler(nxt_unit_ctx_t *ctx)
1255{
1256 VALUE res;
1257 uint32_t i;
1258 nxt_ruby_ctx_t *rctx;
1259 nxt_ruby_app_conf_t *c;
1260
364 ruby_unit_init.data = c;
365 ruby_unit_init.ctx_data = &ruby_ctx;
366
367 unit_ctx = nxt_unit_init(&ruby_unit_init);
368 if (nxt_slow_path(unit_ctx == NULL)) {
369 goto fail;
370 }
371

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

1252static int
1253nxt_ruby_ready_handler(nxt_unit_ctx_t *ctx)
1254{
1255 VALUE res;
1256 uint32_t i;
1257 nxt_ruby_ctx_t *rctx;
1258 nxt_ruby_app_conf_t *c;
1259
1261 /* Worker thread context. */
1262 if (!nxt_unit_is_main_ctx(ctx)) {
1263 return NXT_UNIT_OK;
1264 }
1265
1266 c = ctx->unit->data;
1267
1268 if (c->threads <= 1) {
1269 return NXT_UNIT_OK;
1270 }
1271
1272 for (i = 0; i < c->threads - 1; i++) {
1273 rctx = &nxt_ruby_ctxs[i];

--- 164 unchanged lines hidden ---
1260 c = ctx->unit->data;
1261
1262 if (c->threads <= 1) {
1263 return NXT_UNIT_OK;
1264 }
1265
1266 for (i = 0; i < c->threads - 1; i++) {
1267 rctx = &nxt_ruby_ctxs[i];

--- 164 unchanged lines hidden ---