Lines Matching refs:task

15 static void nxt_port_remove_pid(nxt_task_t *task, nxt_port_recv_msg_t *msg,
17 static void nxt_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg);
23 nxt_port_mp_cleanup(nxt_task_t *task, void *obj, void *data) in nxt_port_mp_cleanup() argument
49 nxt_port_new(nxt_task_t *task, nxt_port_id_t id, nxt_pid_t pid, in nxt_port_new() argument
70 nxt_mp_cleanup(mp, nxt_port_mp_cleanup, task, port, mp); in nxt_port_new()
88 nxt_port_close(nxt_task_t *task, nxt_port_t *port) in nxt_port_close() argument
92 nxt_debug(task, "port %p %d:%d close, type %d", port, port->pid, in nxt_port_close()
96 nxt_port_rpc_close(task, port); in nxt_port_close()
107 nxt_router_app_port_close(task, port); in nxt_port_close()
127 nxt_port_release(nxt_task_t *task, nxt_port_t *port) in nxt_port_release() argument
129 nxt_debug(task, "port %p %d:%d release, type %d", port, port->pid, in nxt_port_release()
139 nxt_process_use(task, port->process, -1); in nxt_port_release()
161 nxt_port_enable(nxt_task_t *task, nxt_port_t *port, in nxt_port_enable() argument
168 nxt_port_read_enable(task, port); in nxt_port_enable()
173 nxt_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_handler() argument
179 nxt_debug(task, "port %d: message type:%uD fds:%d,%d", in nxt_port_handler()
184 handlers[msg->port_msg.type](task, msg); in nxt_port_handler()
189 nxt_alert(task, "port %d: unknown message type:%uD", in nxt_port_handler()
195 nxt_port_quit_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_quit_handler() argument
197 nxt_runtime_quit(task, 0); in nxt_port_quit_handler()
203 nxt_port_send_new_port(nxt_task_t *task, nxt_runtime_t *rt, in nxt_port_send_new_port() argument
209 nxt_debug(task, "new port %d for process %PI", in nxt_port_send_new_port()
221 (void) nxt_port_send_port(task, port, new_port, stream); in nxt_port_send_new_port()
229 nxt_port_send_port(nxt_task_t *task, nxt_port_t *port, nxt_port_t *new_port, in nxt_port_send_port() argument
235 b = nxt_buf_mem_ts_alloc(task, task->thread->engine->mem_pool, in nxt_port_send_port()
241 nxt_debug(task, "send port %FD to process %PI", in nxt_port_send_port()
253 return nxt_port_socket_write2(task, port, NXT_PORT_MSG_NEW_PORT, in nxt_port_send_port()
260 nxt_port_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_new_port_handler() argument
266 rt = task->thread->runtime; in nxt_port_new_port_handler()
272 nxt_debug(task, "new port %d received for process %PI:%d", in nxt_port_new_port_handler()
277 nxt_debug(task, "port %PI:%d already exists", new_port_msg->pid, in nxt_port_new_port_handler()
287 port = nxt_runtime_process_port_create(task, rt, new_port_msg->pid, in nxt_port_new_port_handler()
294 nxt_fd_nonblocking(task, msg->fd[0]); in nxt_port_new_port_handler()
301 port->socket.task = task; in nxt_port_new_port_handler()
303 nxt_port_write_enable(task, port); in nxt_port_new_port_handler()
310 nxt_port_process_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_process_ready_handler() argument
316 rt = task->thread->runtime; in nxt_port_process_ready_handler()
331 nxt_debug(task, "process %PI ready", msg->port_msg.pid); in nxt_port_process_ready_handler()
340 nxt_port_send_new_port(task, rt, port, msg->port_msg.stream); in nxt_port_process_ready_handler()
345 nxt_port_mmap_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_mmap_handler() argument
350 rt = task->thread->runtime; in nxt_port_mmap_handler()
353 nxt_log(task, NXT_LOG_WARN, "invalid fd passed with mmap message"); in nxt_port_mmap_handler()
360 nxt_log(task, NXT_LOG_WARN, "failed to get process #%PI", in nxt_port_mmap_handler()
366 nxt_port_incoming_port_mmap(task, process, msg->fd[0]); in nxt_port_mmap_handler()
375 nxt_port_change_log_file(nxt_task_t *task, nxt_runtime_t *rt, nxt_uint_t slot, in nxt_port_change_log_file() argument
382 nxt_debug(task, "change log file #%ui fd:%FD", slot, fd); in nxt_port_change_log_file()
392 b = nxt_buf_mem_alloc(task->thread->engine->mem_pool, in nxt_port_change_log_file()
400 (void) nxt_port_socket_write(task, port, NXT_PORT_MSG_CHANGE_FILE, in nxt_port_change_log_file()
408 nxt_port_change_log_file_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_change_log_file_handler() argument
415 rt = task->thread->runtime; in nxt_port_change_log_file_handler()
422 nxt_debug(task, "change log file %FD:%FD", msg->fd[0], log_file->fd); in nxt_port_change_log_file_handler()
438 nxt_port_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_data_handler() argument
450 nxt_debug(task, "data: %*s", dump_size, b->mem.pos); in nxt_port_data_handler()
455 nxt_port_remove_notify_others(nxt_task_t *task, nxt_process_t *process) in nxt_port_remove_notify_others() argument
468 rt = task->thread->runtime; in nxt_port_remove_notify_others()
485 buf = nxt_buf_mem_ts_alloc(task, task->thread->engine->mem_pool, in nxt_port_remove_notify_others()
494 nxt_port_socket_write(task, port, NXT_PORT_MSG_REMOVE_PID, -1, in nxt_port_remove_notify_others()
502 nxt_port_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_remove_pid_handler() argument
513 nxt_port_remove_pid(task, msg, pid); in nxt_port_remove_pid_handler()
518 nxt_port_remove_pid(nxt_task_t *task, nxt_port_recv_msg_t *msg, in nxt_port_remove_pid() argument
526 nxt_debug(task, "port remove pid %PI handler", pid); in nxt_port_remove_pid()
528 rt = task->thread->runtime; in nxt_port_remove_pid()
530 nxt_port_rpc_remove_peer(task, msg->port, pid); in nxt_port_remove_pid()
535 nxt_process_close_ports(task, process); in nxt_port_remove_pid()
541 nxt_port_empty_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) in nxt_port_empty_handler() argument
543 nxt_debug(task, "port empty handler"); in nxt_port_empty_handler()
555 nxt_port_post_handler(nxt_task_t *task, void *obj, void *data) in nxt_port_post_handler() argument
567 handler(task, port, data); in nxt_port_post_handler()
569 nxt_port_use(task, port, -1); in nxt_port_post_handler()
574 nxt_port_post(nxt_task_t *task, nxt_port_t *port, in nxt_port_post() argument
579 if (task->thread->engine == port->engine) { in nxt_port_post()
580 handler(task, port, data); in nxt_port_post()
594 pw->work.task = &port->engine->task; in nxt_port_post()
608 nxt_port_release_handler(nxt_task_t *task, nxt_port_t *port, void *data) in nxt_port_release_handler() argument
615 nxt_port_use(nxt_task_t *task, nxt_port_t *port, int i) in nxt_port_use() argument
623 if (port->engine == NULL || task->thread->engine == port->engine) { in nxt_port_use()
624 nxt_port_release(task, port); in nxt_port_use()
629 nxt_port_post(task, port, nxt_port_release_handler, NULL); in nxt_port_use()