aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pipeline
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-06-21 14:04:16 -0700
committerGarrett D'Amore <garrett@damore.org>2017-06-21 14:04:16 -0700
commit763b8deee1fd38566b85d4745a83adae245d9b26 (patch)
tree00404dbc8e6c07fc5a9d8e07f353beff3adefd5a /src/protocol/pipeline
parentf81c7e8cc84bd43bfc3cc5e41f773a0078870312 (diff)
downloadnng-763b8deee1fd38566b85d4745a83adae245d9b26.tar.gz
nng-763b8deee1fd38566b85d4745a83adae245d9b26.tar.bz2
nng-763b8deee1fd38566b85d4745a83adae245d9b26.zip
Make APIs for holding references more consistent.
Diffstat (limited to 'src/protocol/pipeline')
-rw-r--r--src/protocol/pipeline/pull.c8
-rw-r--r--src/protocol/pipeline/push.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/protocol/pipeline/pull.c b/src/protocol/pipeline/pull.c
index b569253d..eb14be81 100644
--- a/src/protocol/pipeline/pull.c
+++ b/src/protocol/pipeline/pull.c
@@ -107,7 +107,7 @@ nni_pull_pipe_start(void *arg)
nni_pull_pipe *pp = arg;
// Start the pending pull...
- nni_pipe_incref(pp->pipe);
+ nni_pipe_hold(pp->pipe);
nni_pull_recv(pp);
return (0);
@@ -134,7 +134,7 @@ nni_pull_recv_cb(void *arg)
if (nni_aio_result(aio) != 0) {
// Failed to get a message, probably the pipe is closed.
nni_pipe_close(pp->pipe);
- nni_pipe_decref(pp->pipe);
+ nni_pipe_rele(pp->pipe);
return;
}
@@ -158,7 +158,7 @@ nni_pull_putq_cb(void *arg)
nni_msg_free(aio->a_msg);
aio->a_msg = NULL;
nni_pipe_close(pp->pipe);
- nni_pipe_decref(pp->pipe);
+ nni_pipe_rele(pp->pipe);
return;
}
@@ -173,7 +173,7 @@ nni_pull_recv(nni_pull_pipe *pp)
// Schedule the aio with callback.
if (nni_pipe_aio_recv(pp->pipe, &pp->recv_aio) != 0) {
nni_pipe_close(pp->pipe);
- nni_pipe_decref(pp->pipe);
+ nni_pipe_rele(pp->pipe);
}
}
diff --git a/src/protocol/pipeline/push.c b/src/protocol/pipeline/push.c
index 9691d8d8..9554b2be 100644
--- a/src/protocol/pipeline/push.c
+++ b/src/protocol/pipeline/push.c
@@ -127,11 +127,11 @@ nni_push_pipe_start(void *arg)
// Schedule a receiver. This is mostly so that we can detect
// a closed transport pipe.
- nni_pipe_incref(pp->pipe);
+ nni_pipe_hold(pp->pipe);
nni_pipe_aio_recv(pp->pipe, &pp->aio_recv);
// Schedule a sender.
- nni_pipe_incref(pp->pipe);
+ nni_pipe_hold(pp->pipe);
nni_msgq_aio_get(push->uwq, &pp->aio_getq);
return (0);
@@ -157,7 +157,7 @@ nni_push_recv_cb(void *arg)
// sends us data, we just discard it.
if (nni_aio_result(&pp->aio_recv) != 0) {
nni_pipe_close(pp->pipe);
- nni_pipe_decref(pp->pipe);
+ nni_pipe_rele(pp->pipe);
return;
}
nni_msg_free(pp->aio_recv.a_msg);
@@ -176,7 +176,7 @@ nni_push_send_cb(void *arg)
nni_msg_free(pp->aio_send.a_msg);
pp->aio_send.a_msg = NULL;
nni_pipe_close(pp->pipe);
- nni_pipe_decref(pp->pipe);
+ nni_pipe_rele(pp->pipe);
return;
}
@@ -193,7 +193,7 @@ nni_push_getq_cb(void *arg)
if (nni_aio_result(aio) != 0) {
// If the socket is closing, nothing else we can do.
nni_pipe_close(pp->pipe);
- nni_pipe_decref(pp->pipe);
+ nni_pipe_rele(pp->pipe);
return;
}