From 0aa1de1316b46bb4af23fdf26759bca08008eaf5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 4 Apr 2018 09:41:12 -0700 Subject: fixes #324 nni_aio_set_synch leads to race condition fixes #325 synchronous aio completion crash fixes #327 move nni_clock() operations to outside the nni_aio_lk. This work was done for the context tree, and is necessary to properly enable that branch. --- src/transport/tls/tls.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/transport/tls') diff --git a/src/transport/tls/tls.c b/src/transport/tls/tls.c index 610a7f7c..a78e8085 100644 --- a/src/transport/tls/tls.c +++ b/src/transport/tls/tls.c @@ -257,8 +257,7 @@ nni_tls_pipe_send_cb(void *arg) n = nni_msg_len(msg); nni_aio_set_msg(aio, NULL); nni_msg_free(msg); - nni_aio_set_synch(aio); - nni_aio_finish(aio, 0, n); + nni_aio_finish_synch(aio, 0, n); } static void @@ -329,9 +328,8 @@ nni_tls_pipe_recv_cb(void *arg) } nni_mtx_unlock(&p->mtx); - nni_aio_set_synch(aio); nni_aio_set_msg(aio, msg); - nni_aio_finish(aio, 0, nni_msg_len(msg)); + nni_aio_finish_synch(aio, 0, nni_msg_len(msg)); return; recv_error: -- cgit v1.2.3-70-g09d2