From d3de15eb854b88844071685f13cb70064d1fda49 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 13 Jul 2017 22:00:19 -0700 Subject: Use the same flow regardless of whether pipe start is used or not. This means that pipe_start always succeeds, and we can guarantee that the pipe_start_cb is always executed, and in another context. This may help when we need to change the way that sockets and endpoints are associated. --- src/core/pipe.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/core/pipe.c') diff --git a/src/core/pipe.c b/src/core/pipe.c index d010935d..a912e736 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -235,20 +235,14 @@ nni_pipe_getopt(nni_pipe *p, int opt, void *val, size_t *szp) return (p->p_tran_ops.p_getopt(p->p_tran_data, opt, val, szp)); } -int +void nni_pipe_start(nni_pipe *p) { - int rv; - if (p->p_tran_ops.p_start == NULL) { - rv = nni_sock_pipe_ready(p->p_sock, p); - return (rv); + nni_aio_finish(&p->p_start_aio, 0, 0); + } else { + p->p_tran_ops.p_start(p->p_tran_data, &p->p_start_aio); } - - p->p_tran_ops.p_start(p->p_tran_data, &p->p_start_aio); - // XXX: Publish event - - return (0); } void * -- cgit v1.2.3-70-g09d2