aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-07 09:49:07 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-07 11:10:18 -0800
commita02b1c7040c77f2549bfee16af36688f6b20ae63 (patch)
treea961acbc8cf0ee52a079708acf999af91641d47f /src/core
parent61869fa985ec3454ea23c394c265b6863749408a (diff)
downloadnng-a02b1c7040c77f2549bfee16af36688f6b20ae63.tar.gz
nng-a02b1c7040c77f2549bfee16af36688f6b20ae63.tar.bz2
nng-a02b1c7040c77f2549bfee16af36688f6b20ae63.zip
aio: do not reschedule or start operations when expire queue is exiting
We do not want to let operations restart if we're in the process of shutting down. This ensures that they get a reasonable hard failure.
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);