From b21d7805523a407a14567017edbdef57ca81781f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 8 Jan 2020 20:34:26 -0800 Subject: fixes #1094 Consider in-lining task and aio This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol --- src/protocol/pair1/pair.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/protocol/pair1') diff --git a/src/protocol/pair1/pair.c b/src/protocol/pair1/pair.c index 2838cb5d..b3b64a79 100644 --- a/src/protocol/pair1/pair.c +++ b/src/protocol/pair1/pair.c @@ -69,7 +69,7 @@ pair1_sock_fini(void *arg) { pair1_sock *s = arg; - nni_aio_fini(s->aio_getq); + nni_aio_free(s->aio_getq); nni_idhash_fini(s->pipes); nni_mtx_fini(&s->mtx); } @@ -88,7 +88,7 @@ pair1_sock_init_impl(void *arg, nni_sock *nsock, bool raw) // Raw mode uses this. nni_mtx_init(&s->mtx); - if ((rv = nni_aio_init(&s->aio_getq, pair1_sock_getq_cb, s)) != 0) { + if ((rv = nni_aio_alloc(&s->aio_getq, pair1_sock_getq_cb, s)) != 0) { pair1_sock_fini(s); return (rv); } @@ -147,10 +147,10 @@ pair1_pipe_fini(void *arg) { pair1_pipe *p = arg; - nni_aio_fini(p->aio_send); - nni_aio_fini(p->aio_recv); - nni_aio_fini(p->aio_putq); - nni_aio_fini(p->aio_getq); + nni_aio_free(p->aio_send); + nni_aio_free(p->aio_recv); + nni_aio_free(p->aio_putq); + nni_aio_free(p->aio_getq); nni_msgq_fini(p->sendq); } @@ -161,10 +161,10 @@ pair1_pipe_init(void *arg, nni_pipe *npipe, void *psock) int rv; if (((rv = nni_msgq_init(&p->sendq, 2)) != 0) || - ((rv = nni_aio_init(&p->aio_send, pair1_pipe_send_cb, p)) != 0) || - ((rv = nni_aio_init(&p->aio_recv, pair1_pipe_recv_cb, p)) != 0) || - ((rv = nni_aio_init(&p->aio_getq, pair1_pipe_getq_cb, p)) != 0) || - ((rv = nni_aio_init(&p->aio_putq, pair1_pipe_putq_cb, p)) != 0)) { + ((rv = nni_aio_alloc(&p->aio_send, pair1_pipe_send_cb, p)) != 0) || + ((rv = nni_aio_alloc(&p->aio_recv, pair1_pipe_recv_cb, p)) != 0) || + ((rv = nni_aio_alloc(&p->aio_getq, pair1_pipe_getq_cb, p)) != 0) || + ((rv = nni_aio_alloc(&p->aio_putq, pair1_pipe_putq_cb, p)) != 0)) { pair1_pipe_fini(p); return (NNG_ENOMEM); } -- cgit v1.2.3-70-g09d2