aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-07 22:19:17 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-07 22:19:17 -0800
commit0f8fc066cca5567ba5c3e068766270bcc5daee21 (patch)
tree716f521521e30c4e877112d642f14deb0b7e8f1a /src/core
parentac007b5a8703504a0579b5c0a6f6771078f36245 (diff)
downloadnng-0f8fc066cca5567ba5c3e068766270bcc5daee21.tar.gz
nng-0f8fc066cca5567ba5c3e068766270bcc5daee21.tar.bz2
nng-0f8fc066cca5567ba5c3e068766270bcc5daee21.zip
Pipe bail shouldn't mess with lists. Doh!
Diffstat (limited to 'src/core')
-rw-r--r--src/core/pipe.c11
1 files changed, 3 insertions, 8 deletions
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);
}