summaryrefslogtreecommitdiffhomepage
path: root/src/go/unit/nxt_go_process.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-09-18 17:35:24 +0300
committerMax Romanov <max.romanov@nginx.com>2017-09-18 17:35:24 +0300
commit4f7e00ef34345235f3b118749b5183a3f1ad5732 (patch)
treea0db28819ec6c3b03cc8f50d48e4c72814488b53 /src/go/unit/nxt_go_process.c
parent75a63256563a1eaf13fbd182800070849c3beb52 (diff)
downloadunit-4f7e00ef34345235f3b118749b5183a3f1ad5732.tar.gz
unit-4f7e00ef34345235f3b118749b5183a3f1ad5732.tar.bz2
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.
Diffstat (limited to 'src/go/unit/nxt_go_process.c')
-rw-r--r--src/go/unit/nxt_go_process.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/go/unit/nxt_go_process.c b/src/go/unit/nxt_go_process.c
index c2b2c01c..736177ea 100644
--- a/src/go/unit/nxt_go_process.c
+++ b/src/go/unit/nxt_go_process.c
@@ -142,6 +142,8 @@ nxt_go_new_incoming_mmap(nxt_pid_t pid, nxt_fd_t fd)
port_mmap->hdr->id, process->incoming.nelts - 1);
}
+ port_mmap->hdr->sent_over = 0xFFFFu;
+
fail:
nxt_go_mutex_unlock(&process->incoming_mutex);