aboutsummaryrefslogtreecommitdiff
path: root/src/core/aio.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2022-04-18 10:25:03 -0400
committerGarrett D'Amore <garrett@damore.org>2022-04-18 17:41:21 -0400
commit722bf4621703ef238fa81018f8c3e68bcef91354 (patch)
tree1389cd6082ecae9ab0db1239f48861ebefea3c4c /src/core/aio.c
parentd9897897fcf9d1276190b5d20955c72fd632acac (diff)
downloadnng-722bf4621703ef238fa81018f8c3e68bcef91354.tar.gz
nng-722bf4621703ef238fa81018f8c3e68bcef91354.tar.bz2
nng-722bf4621703ef238fa81018f8c3e68bcef91354.zip
fixes #1574 Non-blocking version of nng_aio_wait / nng_aio_result
This introduces a new API, nng_aio_busy(), that can be used to query the status of the aio without blocking. Some minor documentation fixes are included.
Diffstat (limited to 'src/core/aio.c')
-rw-r--r--src/core/aio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/aio.c b/src/core/aio.c
index 65d8b984..771cbc95 100644
--- a/src/core/aio.c
+++ b/src/core/aio.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2022 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
@@ -314,6 +314,12 @@ nni_aio_wait(nni_aio *aio)
nni_task_wait(&aio->a_task);
}
+bool
+nni_aio_busy(nni_aio *aio)
+{
+ return (nni_task_busy(&aio->a_task));
+}
+
int
nni_aio_begin(nni_aio *aio)
{