aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/aio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/aio.c b/src/core/aio.c
index e1e9c42f..91b5c85a 100644
--- a/src/core/aio.c
+++ b/src/core/aio.c
@@ -343,7 +343,7 @@ nni_aio_begin(nni_aio *aio)
aio->a_cancel_fn = NULL;
// We should not reschedule anything at this point.
- if (aio->a_stop) {
+ if (aio->a_stop || eq->eq_exit) {
aio->a_result = NNG_ECANCELED;
aio->a_cancel_fn = NULL;
aio->a_expire = NNI_TIME_NEVER;
@@ -380,7 +380,7 @@ nni_aio_schedule(nni_aio *aio, nni_aio_cancel_fn cancel, void *data)
}
nni_mtx_lock(&eq->eq_mtx);
- if (aio->a_stop) {
+ if (aio->a_stop || eq->eq_exit) {
nni_task_abort(&aio->a_task);
nni_mtx_unlock(&eq->eq_mtx);
return (NNG_ECLOSED);