From 0f8fc066cca5567ba5c3e068766270bcc5daee21 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 7 Jan 2017 22:19:17 -0800 Subject: Pipe bail shouldn't mess with lists. Doh! --- src/core/pipe.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/core') diff --git a/src/core/pipe.c b/src/core/pipe.c index 42ffe6a1..150fcd23 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -63,7 +63,8 @@ nni_pipe_close(nni_pipe *p) // nni_pipe_bail is a special version of close, that is used to abort // from nni_pipe_start, when it fails. It requires the lock to be held, // and this prevents us from dropping the lock, possibly leading to race -// conditions. +// conditions. It's critical that this not be called after the pipe is +// started, or deadlock will occur. static void nni_pipe_bail(nni_pipe *p) { @@ -73,13 +74,7 @@ nni_pipe_bail(nni_pipe *p) p->p_tran_ops.pipe_close(p->p_tran_data); } - if (!p->p_reap) { - // schedule deferred reap/close - p->p_reap = 1; - nni_list_remove(&sock->s_pipes, p); - nni_list_append(&sock->s_reaps, p); - nni_cv_wake(&sock->s_cv); - } + nni_pipe_destroy(p); } -- cgit v1.2.3-70-g09d2