aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-26 12:33:57 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-26 12:54:38 -0800
commitfdcb65091eb6c8875bba382072f7f333be972ce1 (patch)
tree5e84a77985f6b36acb5a30d37b45860a371f1f36 /src
parentaa12d17c6dab9177eaad78e8de008fc2d38be0ea (diff)
downloadnng-fdcb65091eb6c8875bba382072f7f333be972ce1.tar.gz
nng-fdcb65091eb6c8875bba382072f7f333be972ce1.tar.bz2
nng-fdcb65091eb6c8875bba382072f7f333be972ce1.zip
device: use nni_aio_start
Diffstat (limited to 'src')
-rw-r--r--src/core/device.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 7084d3e4..24ba5499 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -219,16 +219,14 @@ nni_device(nni_aio *aio, nni_sock *s1, nni_sock *s2)
device_data *d;
int rv;
- if (nni_aio_begin(aio) != 0) {
- return;
- }
+ nni_aio_reset(aio);
nni_mtx_lock(&device_mtx);
if ((rv = device_init(&d, s1, s2)) != 0) {
nni_mtx_unlock(&device_mtx);
nni_aio_finish_error(aio, rv);
return;
}
- if (!nni_aio_defer(aio, device_cancel, d)) {
+ if (!nni_aio_start(aio, device_cancel, d)) {
nni_mtx_unlock(&device_mtx);
nni_reap(&device_reap, d);
}