aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-07 19:32:40 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-07 19:39:38 -0800
commit3ca7bcc0edd0f26c33264d32e7b6f07276e72e3c (patch)
tree99b7a80b4c7241c030e0ee4e1b08f3d515f1db3f /include
parent8af6befd3a3805501e5c13612558241e60b349ba (diff)
downloadnng-3ca7bcc0edd0f26c33264d32e7b6f07276e72e3c.tar.gz
nng-3ca7bcc0edd0f26c33264d32e7b6f07276e72e3c.tar.bz2
nng-3ca7bcc0edd0f26c33264d32e7b6f07276e72e3c.zip
aio: task_abort was a mistake
The use of task_abort to prematurely fail an aio at scheduling time was a mistake, because it could have led to duplicate calls to nng_aio_finish(). We do need to ensure that we leave an indicator so that nni_aio_schedule can return the abort status to caller, in the case that abort is called between the nni_aio_begin and nni_aio_schedule calls.
Diffstat (limited to 'include')
-rw-r--r--include/nng/nng.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h
index 3397ca53..0ce5f46c 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -543,6 +543,8 @@ NNG_DECL void nng_aio_reap(nng_aio *);
// AIO to be free, including for the callback to have completed
// execution. Therefore, the caller must NOT hold any locks that
// are acquired in the callback, or deadlock will occur.
+// No further operations may be scheduled on the aio, stop is
+// a permanent operation.
NNG_DECL void nng_aio_stop(nng_aio *);
// nng_aio_result returns the status/result of the operation. This
@@ -558,6 +560,7 @@ NNG_DECL size_t nng_aio_count(nng_aio *);
// nng_aio_cancel attempts to cancel any in-progress I/O operation.
// The AIO callback will still be executed, but if the cancellation is
// successful then the status will be NNG_ECANCELED.
+// An AIO can only be canceled if it was submitted already.
NNG_DECL void nng_aio_cancel(nng_aio *);
// nng_aio_abort is like nng_aio_cancel, but allows for a different