From 3f3eb3500ddb33bc660ea64092c4402a59d08988 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 26 Dec 2024 16:50:40 -0800 Subject: [PATCH] pipeline: use nni_aio_start --- src/sp/protocol/pipeline0/pull.c | 8 +------- src/sp/protocol/pipeline0/push.c | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/sp/protocol/pipeline0/pull.c b/src/sp/protocol/pipeline0/pull.c index bfd8f6ea3..89981b294 100644 --- a/src/sp/protocol/pipeline0/pull.c +++ b/src/sp/protocol/pipeline0/pull.c @@ -223,17 +223,11 @@ pull0_sock_recv(void *arg, nni_aio *aio) pull0_sock *s = arg; pull0_pipe *p; - if (nni_aio_begin(aio) != 0) { - return; - } - nni_mtx_lock(&s->m); if ((p = nni_list_first(&s->pl)) == NULL) { - int rv; - if ((rv = nni_aio_schedule(aio, pull0_cancel, s)) != 0) { + if (!nni_aio_start(aio, pull0_cancel, s)) { nni_mtx_unlock(&s->m); - nni_aio_finish_error(aio, rv); return; } diff --git a/src/sp/protocol/pipeline0/push.c b/src/sp/protocol/pipeline0/push.c index f99dddc37..bac3f9843 100644 --- a/src/sp/protocol/pipeline0/push.c +++ b/src/sp/protocol/pipeline0/push.c @@ -269,11 +269,6 @@ push0_sock_send(void *arg, nni_aio *aio) push0_pipe *p; nni_msg *m; size_t l; - int rv; - - if (nni_aio_begin(aio) != 0) { - return; - } m = nni_aio_get_msg(aio); l = nni_msg_len(m); @@ -312,8 +307,7 @@ push0_sock_send(void *arg, nni_aio *aio) return; } - if ((rv = nni_aio_schedule(aio, push0_cancel, s)) != 0) { - nni_aio_finish_error(aio, rv); + if (!nni_aio_start(aio, push0_cancel, s)) { nni_mtx_unlock(&s->m); return; }