From 5fb832e06fd4ded6ccc45f943837fd374a9cea7a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 18 Jul 2017 19:52:08 -0700 Subject: Fixes most of the raaces in posix; but at least one remains outstanding. Apparently there are circumstances when a pipedesc may get orphaned form the pollq. This triggers an assertion failure when it occurs. I am still trying to understand how this can occur. Stay tuned. --- src/platform/windows/win_ipc.c | 9 ++++----- src/platform/windows/win_net.c | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/platform/windows') diff --git a/src/platform/windows/win_ipc.c b/src/platform/windows/win_ipc.c index 85e3dfca..bd9ce26d 100644 --- a/src/platform/windows/win_ipc.c +++ b/src/platform/windows/win_ipc.c @@ -333,9 +333,8 @@ nni_win_ipc_acc_finish(nni_win_event *evt, nni_aio *aio) return; } - aio->a_pipe = pipe; // What if the pipe is already finished? - if (nni_aio_finish(aio, 0, 0) != 0) { + if (nni_aio_finish_pipe(aio, 0, pipe) != 0) { nni_plat_ipc_pipe_fini(pipe); } } @@ -391,7 +390,6 @@ nni_win_ipc_acc_start(nni_win_event *evt, nni_aio *aio) void nni_plat_ipc_ep_accept(nni_plat_ipc_ep *ep, nni_aio *aio) { - aio->a_pipe = NULL; nni_win_event_submit(&ep->acc_ev, aio); } @@ -470,8 +468,9 @@ nni_win_ipc_conn_thr(void *arg) ((rv = nni_win_iocp_register(p)) != 0)) { goto fail; } - aio->a_pipe = pipe; - nni_aio_finish(aio, 0, 0); + if (rv = nni_aio_finish_pipe(aio, 0, pipe) != 0) { + nni_plat_ipc_pipe_fini(pipe); + } continue; fail: diff --git a/src/platform/windows/win_net.c b/src/platform/windows/win_net.c index 59fc0986..633dd256 100644 --- a/src/platform/windows/win_net.c +++ b/src/platform/windows/win_net.c @@ -544,8 +544,7 @@ nni_win_tcp_acc_finish(nni_win_event *evt, nni_aio *aio) return; } - aio->a_pipe = pipe; - if (nni_aio_finish(aio, 0, 0) != 0) { + if (nni_aio_finish_pipe(aio, 0, pipe) != 0) { nni_plat_tcp_pipe_fini(pipe); } } -- cgit v1.2.3-70-g09d2