Lines Matching refs:ctx_impl

46     nxt_unit_ctx_impl_t *ctx_impl, void *data);
95 nxt_unit_ctx_impl_t *ctx_impl);
118 nxt_unit_ctx_impl_t *ctx_impl);
148 static void nxt_unit_ctx_free(nxt_unit_ctx_impl_t *ctx_impl);
214 nxt_unit_ctx_impl_t *ctx_impl; member
274 nxt_unit_ctx_impl_t *ctx_impl; member
280 nxt_unit_ctx_impl_t *ctx_impl; member
656 nxt_unit_ctx_init(nxt_unit_impl_t *lib, nxt_unit_ctx_impl_t *ctx_impl, in nxt_unit_ctx_init() argument
661 ctx_impl->ctx.data = data; in nxt_unit_ctx_init()
662 ctx_impl->ctx.unit = &lib->unit; in nxt_unit_ctx_init()
664 rc = pthread_mutex_init(&ctx_impl->mutex, NULL); in nxt_unit_ctx_init()
675 nxt_queue_insert_tail(&lib->contexts, &ctx_impl->link); in nxt_unit_ctx_init()
679 ctx_impl->use_count = 1; in nxt_unit_ctx_init()
680 ctx_impl->wait_items = 0; in nxt_unit_ctx_init()
681 ctx_impl->online = 1; in nxt_unit_ctx_init()
682 ctx_impl->ready = 0; in nxt_unit_ctx_init()
683 ctx_impl->quit_param = NXT_QUIT_GRACEFUL; in nxt_unit_ctx_init()
685 nxt_queue_init(&ctx_impl->free_req); in nxt_unit_ctx_init()
686 nxt_queue_init(&ctx_impl->free_ws); in nxt_unit_ctx_init()
687 nxt_queue_init(&ctx_impl->active_req); in nxt_unit_ctx_init()
688 nxt_queue_init(&ctx_impl->ready_req); in nxt_unit_ctx_init()
689 nxt_queue_init(&ctx_impl->pending_rbuf); in nxt_unit_ctx_init()
690 nxt_queue_init(&ctx_impl->free_rbuf); in nxt_unit_ctx_init()
692 ctx_impl->free_buf = NULL; in nxt_unit_ctx_init()
693 nxt_unit_mmap_buf_insert(&ctx_impl->free_buf, &ctx_impl->ctx_buf[1]); in nxt_unit_ctx_init()
694 nxt_unit_mmap_buf_insert(&ctx_impl->free_buf, &ctx_impl->ctx_buf[0]); in nxt_unit_ctx_init()
696 nxt_queue_insert_tail(&ctx_impl->free_req, &ctx_impl->req.link); in nxt_unit_ctx_init()
697 nxt_queue_insert_tail(&ctx_impl->free_rbuf, &ctx_impl->ctx_read_buf.link); in nxt_unit_ctx_init()
699 ctx_impl->ctx_read_buf.ctx_impl = ctx_impl; in nxt_unit_ctx_init()
701 ctx_impl->req.req.ctx = &ctx_impl->ctx; in nxt_unit_ctx_init()
702 ctx_impl->req.req.unit = &lib->unit; in nxt_unit_ctx_init()
704 ctx_impl->read_port = NULL; in nxt_unit_ctx_init()
705 ctx_impl->requests.slot = 0; in nxt_unit_ctx_init()
714 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_ctx_use() local
716 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_ctx_use()
718 nxt_atomic_fetch_add(&ctx_impl->use_count, 1); in nxt_unit_ctx_use()
726 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_ctx_release() local
728 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_ctx_release()
730 c = nxt_atomic_fetch_add(&ctx_impl->use_count, -1); in nxt_unit_ctx_release()
733 nxt_unit_ctx_free(ctx_impl); in nxt_unit_ctx_release()
1233 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_ctx_ready() local
1235 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_ctx_ready()
1237 if (nxt_slow_path(ctx_impl->ready)) { in nxt_unit_ctx_ready()
1241 ctx_impl->ready = 1; in nxt_unit_ctx_ready()
1246 if (&lib->main_ctx == ctx_impl && lib->callbacks.ready_handler != NULL) { in nxt_unit_ctx_ready()
1250 if (&lib->main_ctx != ctx_impl) { in nxt_unit_ctx_ready()
1253 ctx_impl->ready = 0; in nxt_unit_ctx_ready()
1461 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_request_check_response_port() local
1467 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_request_check_response_port()
1497 nxt_atomic_fetch_add(&ctx_impl->wait_items, 1); in nxt_unit_request_check_response_port()
1570 nxt_atomic_fetch_add(&ctx_impl->wait_items, 1); in nxt_unit_request_check_response_port()
1582 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_send_req_headers_ack() local
1586 ctx_impl = nxt_container_of(req->ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_send_req_headers_ack()
1593 msg.reply_port = ctx_impl->read_port->id.id; in nxt_unit_send_req_headers_ack()
1734 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_request_info_get() local
1737 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_request_info_get()
1741 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_request_info_get()
1743 if (nxt_queue_is_empty(&ctx_impl->free_req)) { in nxt_unit_request_info_get()
1744 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_request_info_get()
1755 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_request_info_get()
1758 lnk = nxt_queue_first(&ctx_impl->free_req); in nxt_unit_request_info_get()
1764 nxt_queue_insert_tail(&ctx_impl->active_req, &req_impl->link); in nxt_unit_request_info_get()
1766 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_request_info_get()
1778 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_request_info_release() local
1782 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_request_info_release()
1814 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_request_info_release()
1818 nxt_queue_insert_tail(&ctx_impl->free_req, &req_impl->link); in nxt_unit_request_info_release()
1820 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_request_info_release()
1831 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_request_info_free() local
1833 ctx_impl = nxt_container_of(req_impl->req.ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_request_info_free()
1837 if (req_impl != &ctx_impl->req) { in nxt_unit_request_info_free()
1838 nxt_unit_free(&ctx_impl->ctx, req_impl); in nxt_unit_request_info_free()
1847 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_websocket_frame_get() local
1850 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_websocket_frame_get()
1852 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_websocket_frame_get()
1854 if (nxt_queue_is_empty(&ctx_impl->free_ws)) { in nxt_unit_websocket_frame_get()
1855 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_websocket_frame_get()
1863 lnk = nxt_queue_first(&ctx_impl->free_ws); in nxt_unit_websocket_frame_get()
1866 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_websocket_frame_get()
1871 ws_impl->ctx_impl = ctx_impl; in nxt_unit_websocket_frame_get()
1890 pthread_mutex_lock(&ws_impl->ctx_impl->mutex); in nxt_unit_websocket_frame_release()
1892 nxt_queue_insert_tail(&ws_impl->ctx_impl->free_ws, &ws_impl->link); in nxt_unit_websocket_frame_release()
1894 pthread_mutex_unlock(&ws_impl->ctx_impl->mutex); in nxt_unit_websocket_frame_release()
2435 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_mmap_buf_get() local
2437 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_mmap_buf_get()
2439 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_mmap_buf_get()
2441 if (ctx_impl->free_buf == NULL) { in nxt_unit_mmap_buf_get()
2442 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_mmap_buf_get()
2450 mmap_buf = ctx_impl->free_buf; in nxt_unit_mmap_buf_get()
2454 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_mmap_buf_get()
2457 mmap_buf->ctx_impl = ctx_impl; in nxt_unit_mmap_buf_get()
2471 pthread_mutex_lock(&mmap_buf->ctx_impl->mutex); in nxt_unit_mmap_buf_release()
2473 nxt_unit_mmap_buf_insert(&mmap_buf->ctx_impl->free_buf, mmap_buf); in nxt_unit_mmap_buf_release()
2475 pthread_mutex_unlock(&mmap_buf->ctx_impl->mutex); in nxt_unit_mmap_buf_release()
2751 nxt_unit_mmap_release(&mmap_buf->ctx_impl->ctx, in nxt_unit_free_outgoing_buf()
2761 nxt_unit_free(&mmap_buf->ctx_impl->ctx, mmap_buf->free_ptr); in nxt_unit_free_outgoing_buf()
2771 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_read_buf_get() local
2774 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_read_buf_get()
2776 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_read_buf_get()
2778 rbuf = nxt_unit_read_buf_get_impl(ctx_impl); in nxt_unit_read_buf_get()
2780 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_read_buf_get()
2789 nxt_unit_read_buf_get_impl(nxt_unit_ctx_impl_t *ctx_impl) in nxt_unit_read_buf_get_impl() argument
2794 if (!nxt_queue_is_empty(&ctx_impl->free_rbuf)) { in nxt_unit_read_buf_get_impl()
2795 link = nxt_queue_first(&ctx_impl->free_rbuf); in nxt_unit_read_buf_get_impl()
2803 rbuf = nxt_unit_malloc(&ctx_impl->ctx, sizeof(nxt_unit_read_buf_t)); in nxt_unit_read_buf_get_impl()
2806 rbuf->ctx_impl = ctx_impl; in nxt_unit_read_buf_get_impl()
2817 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_read_buf_release() local
2819 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_read_buf_release()
2821 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_read_buf_release()
2823 nxt_queue_insert_head(&ctx_impl->free_rbuf, &rbuf->link); in nxt_unit_read_buf_release()
2825 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_read_buf_release()
3633 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_wait_shm_ack() local
3636 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_wait_shm_ack()
3645 res = nxt_unit_ctx_port_recv(ctx, ctx_impl->read_port, rbuf); in nxt_unit_wait_shm_ack()
3659 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_wait_shm_ack()
3661 nxt_queue_insert_tail(&ctx_impl->pending_rbuf, &rbuf->link); in nxt_unit_wait_shm_ack()
3663 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_wait_shm_ack()
3973 mmap_buf->ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_get_outgoing_buf()
3992 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_incoming_mmap() local
4056 ctx_impl = rbuf->ctx_impl; in nxt_unit_incoming_mmap()
4058 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_incoming_mmap()
4060 nxt_queue_insert_head(&ctx_impl->pending_rbuf, &rbuf->link); in nxt_unit_incoming_mmap()
4062 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_incoming_mmap()
4064 nxt_atomic_fetch_add(&ctx_impl->wait_items, -1); in nxt_unit_incoming_mmap()
4066 nxt_unit_awake_ctx(ctx, ctx_impl); in nxt_unit_incoming_mmap()
4075 nxt_unit_awake_ctx(nxt_unit_ctx_t *ctx, nxt_unit_ctx_impl_t *ctx_impl) in nxt_unit_awake_ctx() argument
4079 if (nxt_fast_path(ctx == &ctx_impl->ctx)) { in nxt_unit_awake_ctx()
4083 if (nxt_slow_path(ctx_impl->read_port == NULL in nxt_unit_awake_ctx()
4084 || ctx_impl->read_port->out_fd == -1)) in nxt_unit_awake_ctx()
4095 (void) nxt_unit_port_send(ctx, ctx_impl->read_port, in nxt_unit_awake_ctx()
4160 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_check_rbuf_mmap() local
4185 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_check_rbuf_mmap()
4187 nxt_atomic_fetch_add(&ctx_impl->wait_items, 1); in nxt_unit_check_rbuf_mmap()
4299 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_get_mmap() local
4307 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_get_mmap()
4312 m.msg.reply_port = ctx_impl->read_port->id.id; in nxt_unit_get_mmap()
4522 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_run() local
4526 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_run()
4530 while (nxt_fast_path(ctx_impl->online)) { in nxt_unit_run()
4600 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_read_buf() local
4604 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_read_buf()
4606 if (ctx_impl->wait_items > 0 || !nxt_unit_chk_ready(ctx)) { in nxt_unit_read_buf()
4607 return nxt_unit_ctx_port_recv(ctx, ctx_impl->read_port, rbuf); in nxt_unit_read_buf()
4610 port_impl = nxt_container_of(ctx_impl->read_port, nxt_unit_port_impl_t, in nxt_unit_read_buf()
4618 res = nxt_unit_port_queue_recv(ctx_impl->read_port, rbuf); in nxt_unit_read_buf()
4624 (int) ctx_impl->read_port->id.pid, in nxt_unit_read_buf()
4625 (int) ctx_impl->read_port->id.id, in nxt_unit_read_buf()
4630 (int) ctx_impl->read_port->id.pid, in nxt_unit_read_buf()
4631 (int) ctx_impl->read_port->id.id, in nxt_unit_read_buf()
4654 fds[0].fd = ctx_impl->read_port->in_fd; in nxt_unit_read_buf()
4681 res = nxt_unit_ctx_port_recv(ctx, ctx_impl->read_port, rbuf); in nxt_unit_read_buf()
4710 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_chk_ready() local
4712 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_chk_ready()
4715 return (ctx_impl->ready in nxt_unit_chk_ready()
4726 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_process_pending_rbuf() local
4729 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_process_pending_rbuf()
4731 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_process_pending_rbuf()
4733 if (nxt_queue_is_empty(&ctx_impl->pending_rbuf)) { in nxt_unit_process_pending_rbuf()
4734 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_process_pending_rbuf()
4741 nxt_queue_add(&pending_rbuf, &ctx_impl->pending_rbuf); in nxt_unit_process_pending_rbuf()
4742 nxt_queue_init(&ctx_impl->pending_rbuf); in nxt_unit_process_pending_rbuf()
4744 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_process_pending_rbuf()
4751 rc = nxt_unit_process_msg(&ctx_impl->ctx, rbuf, NULL); in nxt_unit_process_pending_rbuf()
4759 if (!ctx_impl->ready) { in nxt_unit_process_pending_rbuf()
4773 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_process_ready_req() local
4777 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_process_ready_req()
4779 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_process_ready_req()
4781 if (nxt_queue_is_empty(&ctx_impl->ready_req)) { in nxt_unit_process_ready_req()
4782 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_process_ready_req()
4789 nxt_queue_add(&ready_req, &ctx_impl->ready_req); in nxt_unit_process_ready_req()
4790 nxt_queue_init(&ctx_impl->ready_req); in nxt_unit_process_ready_req()
4792 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_process_ready_req()
4797 lib = nxt_container_of(ctx_impl->ctx.unit, nxt_unit_impl_t, unit); in nxt_unit_process_ready_req()
4840 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_run_ctx() local
4844 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_run_ctx()
4848 while (nxt_fast_path(ctx_impl->online)) { in nxt_unit_run_ctx()
4857 rc = nxt_unit_ctx_port_recv(ctx, ctx_impl->read_port, rbuf); in nxt_unit_run_ctx()
5165 nxt_unit_ctx_free(nxt_unit_ctx_impl_t *ctx_impl) in nxt_unit_ctx_free() argument
5173 lib = nxt_container_of(ctx_impl->ctx.unit, nxt_unit_impl_t, unit); in nxt_unit_ctx_free()
5175 nxt_queue_each(req_impl, &ctx_impl->active_req, in nxt_unit_ctx_free()
5184 nxt_unit_mmap_buf_unlink(&ctx_impl->ctx_buf[0]); in nxt_unit_ctx_free()
5185 nxt_unit_mmap_buf_unlink(&ctx_impl->ctx_buf[1]); in nxt_unit_ctx_free()
5187 while (ctx_impl->free_buf != NULL) { in nxt_unit_ctx_free()
5188 mmap_buf = ctx_impl->free_buf; in nxt_unit_ctx_free()
5190 nxt_unit_free(&ctx_impl->ctx, mmap_buf); in nxt_unit_ctx_free()
5193 nxt_queue_each(req_impl, &ctx_impl->free_req, in nxt_unit_ctx_free()
5200 nxt_queue_each(ws_impl, &ctx_impl->free_ws, in nxt_unit_ctx_free()
5203 nxt_unit_websocket_frame_free(&ctx_impl->ctx, ws_impl); in nxt_unit_ctx_free()
5207 nxt_queue_each(rbuf, &ctx_impl->free_rbuf, nxt_unit_read_buf_t, link) in nxt_unit_ctx_free()
5209 if (rbuf != &ctx_impl->ctx_read_buf) { in nxt_unit_ctx_free()
5210 nxt_unit_free(&ctx_impl->ctx, rbuf); in nxt_unit_ctx_free()
5214 pthread_mutex_destroy(&ctx_impl->mutex); in nxt_unit_ctx_free()
5218 nxt_queue_remove(&ctx_impl->link); in nxt_unit_ctx_free()
5222 if (nxt_fast_path(ctx_impl->read_port != NULL)) { in nxt_unit_ctx_free()
5223 nxt_unit_remove_port(lib, NULL, &ctx_impl->read_port->id); in nxt_unit_ctx_free()
5224 nxt_unit_port_release(ctx_impl->read_port); in nxt_unit_ctx_free()
5227 if (ctx_impl != &lib->main_ctx) { in nxt_unit_ctx_free()
5228 nxt_unit_free(&lib->main_ctx.ctx, ctx_impl); in nxt_unit_ctx_free()
5605 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_process_awaiting_req() local
5613 ctx_impl = nxt_container_of(req_impl->req.ctx, nxt_unit_ctx_impl_t, in nxt_unit_process_awaiting_req()
5616 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_process_awaiting_req()
5618 nxt_queue_insert_tail(&ctx_impl->ready_req, in nxt_unit_process_awaiting_req()
5621 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_process_awaiting_req()
5623 nxt_atomic_fetch_add(&ctx_impl->wait_items, -1); in nxt_unit_process_awaiting_req()
5625 nxt_unit_awake_ctx(ctx, ctx_impl); in nxt_unit_process_awaiting_req()
5744 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_quit() local
5755 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_quit()
5757 nxt_unit_debug(ctx, "quit: %d/%d/%d", (int) quit_param, ctx_impl->ready, in nxt_unit_quit()
5758 ctx_impl->online); in nxt_unit_quit()
5760 if (nxt_slow_path(!ctx_impl->online)) { in nxt_unit_quit()
5765 && !ctx_impl->ready; in nxt_unit_quit()
5769 if (nxt_fast_path(ctx_impl->ready)) { in nxt_unit_quit()
5770 ctx_impl->ready = 0; in nxt_unit_quit()
5778 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_quit()
5780 quit = nxt_queue_is_empty(&ctx_impl->active_req) in nxt_unit_quit()
5781 && nxt_queue_is_empty(&ctx_impl->pending_rbuf) in nxt_unit_quit()
5782 && ctx_impl->wait_items == 0; in nxt_unit_quit()
5784 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_quit()
5788 ctx_impl->quit_param = NXT_QUIT_GRACEFUL; in nxt_unit_quit()
5792 ctx_impl->online = 0; in nxt_unit_quit()
5798 nxt_queue_each(req_impl, &ctx_impl->active_req, in nxt_unit_quit()
5816 if (nxt_fast_path(ctx_impl->read_port != NULL)) { in nxt_unit_quit()
5817 nxt_unit_remove_port(lib, ctx, &ctx_impl->read_port->id); in nxt_unit_quit()
5833 nxt_queue_each(ctx_impl, &lib->contexts, nxt_unit_ctx_impl_t, link) { in nxt_unit_quit()
5835 if (ctx == &ctx_impl->ctx in nxt_unit_quit()
5836 || ctx_impl->read_port == NULL in nxt_unit_quit()
5837 || ctx_impl->read_port->out_fd == -1) in nxt_unit_quit()
5842 (void) nxt_unit_port_send(ctx, ctx_impl->read_port, in nxt_unit_quit()
5856 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_get_port() local
5864 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_get_port()
5869 m.msg.reply_port = ctx_impl->read_port->id.id; in nxt_unit_get_port()
6482 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_request_hash_add() local
6500 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_request_hash_add()
6502 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_request_hash_add()
6504 res = nxt_lvlhsh_insert(&ctx_impl->requests, &lhq); in nxt_unit_request_hash_add()
6506 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_request_hash_add()
6525 nxt_unit_ctx_impl_t *ctx_impl; in nxt_unit_request_hash_find() local
6534 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_request_hash_find()
6536 pthread_mutex_lock(&ctx_impl->mutex); in nxt_unit_request_hash_find()
6539 res = nxt_lvlhsh_delete(&ctx_impl->requests, &lhq); in nxt_unit_request_hash_find()
6542 res = nxt_lvlhsh_find(&ctx_impl->requests, &lhq); in nxt_unit_request_hash_find()
6545 pthread_mutex_unlock(&ctx_impl->mutex); in nxt_unit_request_hash_find()