diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-12-27 17:46:17 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-12-27 17:46:17 +0300 |
commit | 89c0f7c5db5003b8fd8df3e1babb0c802004bf4c (patch) | |
tree | 7ac164d6fe41fd76beb3d328e6fde4020f744b63 /src/nxt_port_memory.h | |
parent | 45d08d5145c63fd788f85d9e789314dcf093c99e (diff) | |
download | unit-89c0f7c5db5003b8fd8df3e1babb0c802004bf4c.tar.gz unit-89c0f7c5db5003b8fd8df3e1babb0c802004bf4c.tar.bz2 |
Implementing the ability to cancel request before worker starts processing it.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_port_memory.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/nxt_port_memory.h b/src/nxt_port_memory.h index d1f29df8..c6a49ccf 100644 --- a/src/nxt_port_memory.h +++ b/src/nxt_port_memory.h @@ -15,6 +15,27 @@ typedef struct nxt_port_mmap_handler_s nxt_port_mmap_handler_t; void nxt_port_mmaps_destroy(nxt_port_mmaps_t *port_mmaps, nxt_bool_t free_elts); +typedef struct nxt_port_mmap_tracking_s nxt_port_mmap_tracking_t; + +struct nxt_port_mmap_tracking_s { + void *mmap_handler; + nxt_atomic_t *tracking; +}; + +nxt_int_t +nxt_port_mmap_get_tracking(nxt_task_t *task, nxt_port_t *port, + nxt_port_mmap_tracking_t *tracking, uint32_t stream); + +nxt_bool_t +nxt_port_mmap_tracking_cancel(nxt_task_t *task, + nxt_port_mmap_tracking_t *tracking, uint32_t stream); + +nxt_int_t +nxt_port_mmap_tracking_write(uint32_t *buf, nxt_port_mmap_tracking_t *t); + +nxt_bool_t +nxt_port_mmap_tracking_read(nxt_task_t *task, nxt_port_recv_msg_t *msg); + /* * Allocates nxt_but_t structure from port's mem_pool, assigns this buf 'mem' * pointers to first available shared mem bucket(s). 'size' used as a hint to @@ -37,8 +58,7 @@ nxt_port_mmap_write(nxt_task_t *task, nxt_port_t *port, nxt_port_send_msg_t *msg, nxt_sendbuf_coalesce_t *sb); void -nxt_port_mmap_read(nxt_task_t *task, nxt_port_t *port, - nxt_port_recv_msg_t *msg); +nxt_port_mmap_read(nxt_task_t *task, nxt_port_recv_msg_t *msg); enum nxt_port_method_e { NXT_PORT_METHOD_ANY = 0, |