diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-05-12 20:32:41 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-05-12 20:32:41 +0300 |
commit | f7b4bdfd892a0b479dc946896435a3ba7f9615dd (patch) | |
tree | a6f0c4ebaeed2d9f0fcb1c07178b52a684a53280 /src/nxt_process.h | |
parent | 1782c771fab999b37a8c04ed72760e3528205be7 (diff) | |
download | unit-f7b4bdfd892a0b479dc946896435a3ba7f9615dd.tar.gz unit-f7b4bdfd892a0b479dc946896435a3ba7f9615dd.tar.bz2 |
Using shared memory to send data via nxt_port.
Usage:
b = nxt_port_mmap_get_buf(task, port, size);
b->mem.free = nxt_cpymem(b->mem.free, data, size);
nxt_port_socket_write(task, port, NXT_PORT_MSG_DATA, -1, 0, b);
Diffstat (limited to 'src/nxt_process.h')
-rw-r--r-- | src/nxt_process.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/nxt_process.h b/src/nxt_process.h index 92f673a2..b6262106 100644 --- a/src/nxt_process.h +++ b/src/nxt_process.h @@ -49,9 +49,15 @@ struct nxt_process_init_s { typedef struct { + nxt_mem_pool_t *mem_pool; + nxt_pid_t pid; - nxt_array_t *ports; /* of nxt_port_t */ + nxt_queue_t ports; /* of nxt_port_t */ + nxt_port_id_t last_port_id; + nxt_process_init_t *init; + nxt_array_t *incoming; /* of nxt_mmap_t */ + nxt_array_t *outgoing; /* of nxt_mmap_t */ } nxt_process_t; @@ -65,6 +71,22 @@ NXT_EXPORT void nxt_nanosleep(nxt_nsec_t ns); NXT_EXPORT void nxt_process_arguments(nxt_task_t *task, char **orig_argv, char ***orig_envp); +NXT_EXPORT nxt_port_t * nxt_process_port_new(nxt_process_t *process); + +#define nxt_process_port_remove(port) \ + nxt_queue_remove(&port->link) + +#define nxt_process_port_first(process) \ + nxt_queue_link_data(nxt_queue_first(&process->ports), nxt_port_t, link) + +#define nxt_process_port_add(process, port) \ + nxt_queue_insert_tail(&process->ports, &port->link) + +#define nxt_process_port_each(process, port) \ + nxt_queue_each(port, &process->ports, nxt_port_t, link) + +#define nxt_process_port_loop \ + nxt_queue_loop #if (NXT_HAVE_SETPROCTITLE) |