aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-07-02 16:09:14 -0700
committerGarrett D'Amore <garrett@damore.org>2017-07-02 16:09:14 -0700
commit4ed9dadf5e7d17fd42ef4df836b0932972dd29c1 (patch)
treede5581a25a0a8d16a3efc74197c8784b30d827bd /src/core
parentac1cdf1a4a2bff6d2ad469735d6825881f5045d9 (diff)
downloadnng-4ed9dadf5e7d17fd42ef4df836b0932972dd29c1.tar.gz
nng-4ed9dadf5e7d17fd42ef4df836b0932972dd29c1.tar.bz2
nng-4ed9dadf5e7d17fd42ef4df836b0932972dd29c1.zip
Use common aio cancellation.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/msgqueue.c12
-rw-r--r--src/core/msgqueue.h1
-rw-r--r--src/core/socket.c10
3 files changed, 0 insertions, 23 deletions
diff --git a/src/core/msgqueue.c b/src/core/msgqueue.c
index 3d373e2b..19ca116e 100644
--- a/src/core/msgqueue.c
+++ b/src/core/msgqueue.c
@@ -441,18 +441,6 @@ nni_msgq_aio_get(nni_msgq *mq, nni_aio *aio)
}
-void
-nni_msgq_aio_cancel(nni_msgq *mq, nni_aio *aio)
-{
- nni_mtx_lock(&mq->mq_lock);
- if (nni_list_active(&mq->mq_aio_getq, aio)) {
- nni_list_remove(&mq->mq_aio_getq, aio);
- nni_aio_finish(aio, NNG_ECANCELED, 0);
- }
- nni_mtx_unlock(&mq->mq_lock);
-}
-
-
int
nni_msgq_canput(nni_msgq *mq)
{
diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h
index 682c9821..af3bc835 100644
--- a/src/core/msgqueue.h
+++ b/src/core/msgqueue.h
@@ -41,7 +41,6 @@ extern void nni_msgq_aio_put(nni_msgq *, nni_aio *);
extern void nni_msgq_aio_get(nni_msgq *, nni_aio *);
extern void nni_msgq_aio_notify_get(nni_msgq *, nni_aio *);
extern void nni_msgq_aio_notify_put(nni_msgq *, nni_aio *);
-extern void nni_msgq_aio_cancel(nni_msgq *, nni_aio *);
// nni_msgq_put puts the message to the queue. It blocks until it
// was able to do so, or the queue is closed, returning either 0 on
diff --git a/src/core/socket.c b/src/core/socket.c
index 4535d2f4..d9d9ae3b 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -227,16 +227,6 @@ fail:
void
nni_sock_unnotify(nni_sock *sock, nni_notify *notify)
{
- switch (notify->n_type) {
- case NNG_EV_CAN_RCV:
- nni_msgq_aio_cancel(sock->s_urq, &notify->n_aio);
- break;
- case NNG_EV_CAN_SND:
- nni_msgq_aio_cancel(sock->s_uwq, &notify->n_aio);
- break;
- default:
- return;
- }
nni_aio_fini(&notify->n_aio);
NNI_FREE_STRUCT(notify);
}