From 763b8deee1fd38566b85d4745a83adae245d9b26 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 21 Jun 2017 14:04:16 -0700 Subject: Make APIs for holding references more consistent. --- src/protocol/pipeline/pull.c | 8 ++++---- src/protocol/pipeline/push.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/protocol/pipeline') 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; } -- cgit v1.2.3-70-g09d2