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/protocol/pubsub/sub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/protocol/pubsub/sub.c') diff --git a/src/protocol/pubsub/sub.c b/src/protocol/pubsub/sub.c index 36a42c49..03d76e2d 100644 --- a/src/protocol/pubsub/sub.c +++ b/src/protocol/pubsub/sub.c @@ -123,8 +123,8 @@ nni_sub_pipe_stop(void *arg) { nni_sub_pipe *sp = arg; - nni_aio_cancel(&sp->aio_putq, NNG_ECANCELED); - nni_aio_cancel(&sp->aio_recv, NNG_ECANCELED); + nni_aio_stop(&sp->aio_putq); + nni_aio_stop(&sp->aio_recv); } static void -- cgit v1.2.3-70-g09d2