Fixing shared memory thread safety issue.
Do not reuse shared memory segment with different port until this segment successfully received and indexed on other side. However, segment can be used to transfer data via the port it was sent at any time.
This commit is contained in:
@@ -49,6 +49,7 @@ typedef nxt_atomic_uint_t nxt_free_map_t;
|
||||
struct nxt_port_mmap_header_s {
|
||||
uint32_t id;
|
||||
nxt_pid_t pid; /* For sanity check. */
|
||||
nxt_port_id_t sent_over;
|
||||
nxt_free_map_t free_map[MAX_FREE_IDX];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user