aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/msgqueue.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/msgqueue.c b/src/core/msgqueue.c
index 8118c6c2..f0f2de8b 100644
--- a/src/core/msgqueue.c
+++ b/src/core/msgqueue.c
@@ -213,14 +213,11 @@ nni_msgq_cancel(nni_aio *aio, void *arg, int rv)
void
nni_msgq_aio_put(nni_msgq *mq, nni_aio *aio)
{
- if (nni_aio_begin(aio) != 0) {
- return;
- }
nni_mtx_lock(&mq->mq_lock);
// If this is an instantaneous poll operation, and the queue has
// no room, nobody is waiting to receive, then report NNG_ETIMEDOUT.
- if (!nni_aio_defer(aio, nni_msgq_cancel, mq)) {
+ if (!nni_aio_start(aio, nni_msgq_cancel, mq)) {
nni_mtx_unlock(&mq->mq_lock);
return;
}
@@ -234,11 +231,8 @@ nni_msgq_aio_put(nni_msgq *mq, nni_aio *aio)
void
nni_msgq_aio_get(nni_msgq *mq, nni_aio *aio)
{
- if (nni_aio_begin(aio) != 0) {
- return;
- }
nni_mtx_lock(&mq->mq_lock);
- if (!nni_aio_defer(aio, nni_msgq_cancel, mq)) {
+ if (!nni_aio_start(aio, nni_msgq_cancel, mq)) {
nni_mtx_unlock(&mq->mq_lock);
return;
}