From a37093079b492e966344416445aae354b147d30e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 20 Jul 2017 14:34:51 -0700 Subject: Yet more race condition fixes. We need to remember that protocol stops can run synchronously, and therefore we need to wait for the aio to complete. Further, we need to break apart shutting down aio activity from deallocation, as we need to shut down *all* async activity before deallocating *anything*. Noticed that we had a pipe race in the surveyor pattern too. --- src/core/socket.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/socket.h') diff --git a/src/core/socket.h b/src/core/socket.h index d0196eea..41dfbc33 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -87,8 +87,11 @@ extern void nni_sock_unnotify(nni_sock *, nni_notify *); extern void nni_sock_ep_remove(nni_sock *, nni_ep *); // nni_sock_pipe_add adds the pipe to the socket. It is called by -// the generic pipe creation code. -extern int nni_sock_pipe_add(nni_sock *, nni_pipe *); +// the generic pipe creation code. It also adds the socket to the +// ep list, and starts the pipe. It does all these to ensure that +// we have complete success or failure, and there is no point where +// a pipe could wind up orphaned. +extern int nni_sock_pipe_add(nni_sock *, nni_ep *, nni_pipe *); extern void nni_sock_pipe_remove(nni_sock *, nni_pipe *); -- cgit v1.2.3-70-g09d2