From a37093079b492e966344416445aae354b147d30e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 20 Jul 2017 14:34:51 -0700 Subject: Yet more race condition fixes. We need to remember that protocol stops can run synchronously, and therefore we need to wait for the aio to complete. Further, we need to break apart shutting down aio activity from deallocation, as we need to shut down *all* async activity before deallocating *anything*. Noticed that we had a pipe race in the surveyor pattern too. --- src/core/taskq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/taskq.c') diff --git a/src/core/taskq.c b/src/core/taskq.c index 36129bfd..64179790 100644 --- a/src/core/taskq.c +++ b/src/core/taskq.c @@ -1,5 +1,6 @@ // // Copyright 2017 Garrett D'Amore +// Copyright 2017 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -153,7 +154,7 @@ nni_taskq_dispatch(nni_taskq *tq, nni_taskq_ent *ent) return (NNG_ECLOSED); } // It might already be scheduled... if so don't redo it. - if (ent->tqe_tq == NULL) { + if (!nni_list_active(&tq->tq_ents, ent)) { ent->tqe_tq = tq; nni_list_append(&tq->tq_ents, ent); } -- cgit v1.2.3-70-g09d2