Skip to content

Commit

Permalink
pipeline: use nni_aio_start
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Dec 27, 2024
1 parent be0cd10 commit 3f3eb35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/sp/protocol/pipeline0/pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 1 addition & 7 deletions src/sp/protocol/pipeline0/push.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 3f3eb35

Please sign in to comment.