diff options
| -rw-r--r-- | src/transport/ipc/ipc.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c index a019dfbc..b799dba1 100644 --- a/src/transport/ipc/ipc.c +++ b/src/transport/ipc/ipc.c @@ -143,11 +143,10 @@ nni_ipc_cancel_start(nni_aio *aio) nni_ipc_pipe *pipe = aio->a_prov_data; nni_mtx_lock(&pipe->mtx); - if ((aio = pipe->user_negaio) != NULL) { - pipe->user_negaio = NULL; - nni_aio_stop(aio); - } + pipe->user_negaio = NULL; nni_mtx_unlock(&pipe->mtx); + + nni_aio_cancel(&pipe->negaio, aio->a_result); } static void @@ -325,8 +324,7 @@ nni_ipc_cancel_tx(nni_aio *aio) pipe->user_txaio = NULL; nni_mtx_unlock(&pipe->mtx); - // stop the underlying aio ... we don't want a result for it. - nni_aio_stop(&pipe->txaio); + nni_aio_cancel(&pipe->txaio, aio->a_result); } static void @@ -370,8 +368,7 @@ nni_ipc_cancel_rx(nni_aio *aio) pipe->user_rxaio = NULL; nni_mtx_unlock(&pipe->mtx); - // stop the underlying aio ... we don't want a result for it. - nni_aio_stop(&pipe->rxaio); + nni_aio_cancel(&pipe->rxaio, aio->a_result); } static void @@ -573,11 +570,10 @@ nni_ipc_cancel_ep(nni_aio *aio) nni_ipc_ep *ep = aio->a_prov_data; nni_mtx_lock(&ep->mtx); - if (ep->user_aio == aio) { - ep->user_aio = NULL; - } - nni_aio_stop(&ep->aio); + ep->user_aio = NULL; nni_mtx_unlock(&ep->mtx); + + nni_aio_cancel(&ep->aio, aio->a_result); } static void |
