From 800c9b609ded23caa5050121deb5c97ccbaedf63 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 16 Jul 2017 14:08:37 -0700 Subject: Close negotiation race. --- src/core/pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/pipe.c b/src/core/pipe.c index c98a3243..7b285575 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -53,7 +53,6 @@ nni_pipe_destroy(nni_pipe *p) return; } - nni_aio_fini(&p->p_start_aio); if (p->p_proto_data != NULL) { p->p_proto_dtor(p->p_proto_data); } @@ -108,6 +107,9 @@ nni_pipe_close(nni_pipe *p) } nni_mtx_unlock(&p->p_mtx); + + // Ensure that the negotiation step is aborted fully. + nni_aio_fini(&p->p_start_aio); } // Pipe reap is called on a taskq when the pipe should be closed. No -- cgit v1.2.3-70-g09d2