From eab6a4d2d96d11d3926e927c135362fc166895f0 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 16 May 2018 14:12:29 -0700 Subject: fixes #445 crash in taskq_thread This changes the array of flags, which was confusing, brittle, and racy, into a much simpler reference (busy) count on the task structures. This allows us to support certain kinds of "reentrant" dispatching, where either a synchronous or asynchronous task can reschedule / dispatch itself. The new code also helps reduce certain lock pressure, as a bonus. --- src/core/aio.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/aio.c') diff --git a/src/core/aio.c b/src/core/aio.c index 6276589b..99da356a 100644 --- a/src/core/aio.c +++ b/src/core/aio.c @@ -315,7 +315,6 @@ nni_aio_begin(nni_aio *aio) nni_mtx_lock(&nni_aio_lk); // We should not reschedule anything at this point. if (aio->a_stop) { - nni_task_unprep(aio->a_task); aio->a_result = NNG_ECANCELED; nni_mtx_unlock(&nni_aio_lk); return (NNG_ECANCELED); -- cgit v1.2.3-70-g09d2