aboutsummaryrefslogtreecommitdiff
path: root/src/core/aio.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2021-08-09 22:39:46 -0700
committerGarrett D'Amore <garrett@damore.org>2021-08-09 22:39:46 -0700
commiteca7cb3ac170e159f5a5b79f68b1890409f7179e (patch)
tree1ae94d6ed3ec2b66af3c745dd89e626bfcc07b7c /src/core/aio.h
parent22f089b6b5ebe3be380c33c926990fe891ae0da9 (diff)
downloadnng-eca7cb3ac170e159f5a5b79f68b1890409f7179e.tar.gz
nng-eca7cb3ac170e159f5a5b79f68b1890409f7179e.tar.bz2
nng-eca7cb3ac170e159f5a5b79f68b1890409f7179e.zip
fixes #1488 aio expiration list performance work needed
There were several problems with the array implementation, both from performance and from correctness. This corrects those errors (hopefully) and restores the expiration lists as linked lists.
Diffstat (limited to 'src/core/aio.h')
-rw-r--r--src/core/aio.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/aio.h b/src/core/aio.h
index ba231bd1..9ef5f63d 100644
--- a/src/core/aio.h
+++ b/src/core/aio.h
@@ -1,5 +1,5 @@
//
-// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -167,10 +167,10 @@ extern void nni_aio_sys_fini(void);
typedef struct nni_aio_expire_q nni_aio_expire_q;
-// An nni_aio is an async I/O handle. The details of this aio structure
+// nng_aio is an async I/O handle. The details of this aio structure
// are private to the AIO framework. The structure has the public name
// (nng_aio) so that we minimize the pollution in the public API namespace.
-// It is a coding error for anything out side of the AIO framework to access
+// It is a coding error for anything outside the AIO framework to access
// any of these members -- the definition is provided here to facilitate
// inlining, but that should be the only use.
struct nng_aio {
@@ -181,6 +181,7 @@ struct nng_aio {
bool a_stop; // Shutting down (no new operations)
bool a_sleep; // Sleeping with no action
bool a_expire_ok; // Expire from sleep is ok
+ bool a_expiring; // Expiration in progress
nni_task a_task;
// Read/write operations.
@@ -198,9 +199,9 @@ struct nng_aio {
// Provider-use fields.
nni_aio_cancel_fn a_cancel_fn;
- void * a_cancel_arg;
+ void *a_cancel_arg;
nni_list_node a_prov_node; // Linkage on provider list.
- void * a_prov_extra[2]; // Extra data used by provider
+ void *a_prov_extra[2]; // Extra data used by provider
nni_aio_expire_q *a_expire_q;
nni_list_node a_expire_node; // Expiration node