aboutsummaryrefslogtreecommitdiff
path: root/src/core/device.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-01-08 20:34:26 -0800
committerGarrett D'Amore <garrett@damore.org>2020-01-08 21:16:30 -0800
commitb21d7805523a407a14567017edbdef57ca81781f (patch)
treee07f08bdc047ee4dfb057b670766e3de5bf2f981 /src/core/device.c
parent8479b4c8861c77cfd9eb64e724615605bdd1cbcb (diff)
downloadnng-b21d7805523a407a14567017edbdef57ca81781f.tar.gz
nng-b21d7805523a407a14567017edbdef57ca81781f.tar.bz2
nng-b21d7805523a407a14567017edbdef57ca81781f.zip
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
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/device.c b/src/core/device.c
index fee108a8..71480bbc 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -94,7 +94,7 @@ nni_device_fini(nni_device_data *dd)
}
for (i = 0; i < dd->npath; i++) {
nni_device_path *p = &dd->paths[i];
- nni_aio_fini(p->aio);
+ nni_aio_free(p->aio);
}
nni_mtx_fini(&dd->mtx);
NNI_FREE_STRUCT(dd);
@@ -172,7 +172,7 @@ nni_device_init(nni_device_data **dp, nni_sock *s1, nni_sock *s2)
p->dst = i == 0 ? s2 : s1;
p->state = NNI_DEVICE_STATE_INIT;
- if ((rv = nni_aio_init(&p->aio, nni_device_cb, p)) != 0) {
+ if ((rv = nni_aio_alloc(&p->aio, nni_device_cb, p)) != 0) {
nni_device_fini(dd);
return (rv);
}
@@ -221,11 +221,11 @@ nni_device(nni_sock *s1, nni_sock *s2)
nni_aio * aio;
int rv;
- if ((rv = nni_aio_init(&aio, NULL, NULL)) != 0) {
+ if ((rv = nni_aio_alloc(&aio, NULL, NULL)) != 0) {
return (rv);
}
if ((rv = nni_device_init(&dd, s1, s2)) != 0) {
- nni_aio_fini(aio);
+ nni_aio_free(aio);
return (rv);
}
nni_device_start(dd, aio);
@@ -233,6 +233,6 @@ nni_device(nni_sock *s1, nni_sock *s2)
rv = nni_aio_result(aio);
nni_device_fini(dd);
- nni_aio_fini(aio);
+ nni_aio_free(aio);
return (rv);
}