From 722bf4621703ef238fa81018f8c3e68bcef91354 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 18 Apr 2022 10:25:03 -0400 Subject: 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. --- src/core/taskq.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/taskq.h') diff --git a/src/core/taskq.h b/src/core/taskq.h index 9cabfd9b..2ff449cf 100644 --- a/src/core/taskq.h +++ b/src/core/taskq.h @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2022 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -43,6 +43,13 @@ extern void nni_task_prep(nni_task *); // returns an error. extern void nni_task_abort(nni_task *); +// nni_task_busy checks to see if a task is still busy. +// This is uses the same check that nni_task_wait uses. +extern bool nni_task_busy(nni_task *); + +// nni_task_wait waits for the task to complete. If additional +// work is scheduled on the task then it will not return until that +// work (or any other work subsequently scheduled) is complete. extern void nni_task_wait(nni_task *); extern void nni_task_init(nni_task *, nni_taskq *, nni_cb, void *); -- cgit v1.2.3-70-g09d2