diff options
| author | Garrett D'Amore <garrett@damore.org> | 2023-12-17 09:51:39 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2023-12-17 09:51:39 -0800 |
| commit | dc499882e82827f39a77669fb7dc5cd7a70aaf40 (patch) | |
| tree | b5244944a3a13763cc9403ced9443ad601f456ad /src/core/aio.h | |
| parent | 9f34ec0a450dd2a9ef11aa29d07948144ec97de4 (diff) | |
| download | nng-dc499882e82827f39a77669fb7dc5cd7a70aaf40.tar.gz nng-dc499882e82827f39a77669fb7dc5cd7a70aaf40.tar.bz2 nng-dc499882e82827f39a77669fb7dc5cd7a70aaf40.zip | |
fixes #1728 surveyor could be simplified to not use timer
Diffstat (limited to 'src/core/aio.h')
| -rw-r--r-- | src/core/aio.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/core/aio.h b/src/core/aio.h index a2ebf70a..cae8610f 100644 --- a/src/core/aio.h +++ b/src/core/aio.h @@ -149,10 +149,12 @@ extern size_t nni_aio_iov_count(nni_aio *); extern int nni_aio_set_iov(nni_aio *, unsigned, const nni_iov *); -extern void nni_aio_set_timeout(nni_aio *, nng_duration); -extern void nni_aio_get_iov(nni_aio *, unsigned *, nni_iov **); -extern void nni_aio_normalize_timeout(nni_aio *, nng_duration); -extern void nni_aio_bump_count(nni_aio *, size_t); +extern void nni_aio_set_timeout(nni_aio *, nng_duration); +extern void nni_aio_set_expire(nni_aio *, nni_time); +extern nng_duration nni_aio_get_timeout(nni_aio *); +extern void nni_aio_get_iov(nni_aio *, unsigned *, nni_iov **); +extern void nni_aio_normalize_timeout(nni_aio *, nng_duration); +extern void nni_aio_bump_count(nni_aio *, size_t); // nni_aio_schedule indicates that the AIO has begun, and is scheduled for // asynchronous completion. This also starts the expiration timer. Note that @@ -187,8 +189,8 @@ extern void nni_aio_completions_run(nni_aio_completions *); // nni_aio_completions_add adds an aio (with the result code and length as // appropriate) to the completion list. This should be done while the // appropriate lock is held. The aio must not be scheduled. -extern void nni_aio_completions_add(nni_aio_completions *, nni_aio *, - int, size_t); +extern void nni_aio_completions_add( + nni_aio_completions *, nni_aio *, int, size_t); extern int nni_aio_sys_init(void); extern void nni_aio_sys_fini(void); @@ -202,14 +204,15 @@ typedef struct nni_aio_expire_q nni_aio_expire_q; // any of these members -- the definition is provided here to facilitate // inlining, but that should be the only use. struct nng_aio { - size_t a_count; // Bytes transferred (I/O only) - nni_time a_expire; // Absolute timeout - nni_duration a_timeout; // Relative timeout - int a_result; // Result code (nng_errno) - 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 + size_t a_count; // Bytes transferred (I/O only) + nni_time a_expire; // Absolute timeout + nni_duration a_timeout; // Relative timeout + int a_result; // Result code (nng_errno) + 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 + bool a_use_expire; // Use expire instead of timeout nni_task a_task; // Read/write operations. @@ -227,8 +230,8 @@ struct nng_aio { // Provider-use fields. nni_aio_cancel_fn a_cancel_fn; - void *a_cancel_arg; - void *a_prov_data; + void *a_cancel_arg; + void *a_prov_data; nni_list_node a_prov_node; // Linkage on provider list. nni_aio_expire_q *a_expire_q; nni_list_node a_expire_node; // Expiration node |
