diff options
Diffstat (limited to 'src/core/device.c')
| -rw-r--r-- | src/core/device.c | 6 |
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); } |
