aboutsummaryrefslogtreecommitdiff
path: root/src/core/taskq.c
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 /src/core/taskq.c
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 'src/core/taskq.c')
-rw-r--r--src/core/taskq.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/core/taskq.c b/src/core/taskq.c
index 1f0ae1b6..53252a8e 100644
--- a/src/core/taskq.c
+++ b/src/core/taskq.c
@@ -199,20 +199,6 @@ nni_task_prep(nni_task *task)
}
void
-nni_task_abort(nni_task *task)
-{
- // This is called when unscheduling the task.
- nni_mtx_lock(&task->task_mtx);
- if (task->task_prep) {
- task->task_prep = false;
- task->task_busy--;
- if (task->task_busy == 0) {
- nni_cv_wake(&task->task_cv);
- }
- }
- nni_mtx_unlock(&task->task_mtx);
-}
-void
nni_task_wait(nni_task *task)
{
nni_mtx_lock(&task->task_mtx);