diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-18 19:52:08 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-18 19:52:08 -0700 |
| commit | 5fb832e06fd4ded6ccc45f943837fd374a9cea7a (patch) | |
| tree | 41c306c297911d740e92f38b98685207f77758c6 /src/platform/windows | |
| parent | 3eb60946ae8b5ad7d8a95233ffe946432acdb837 (diff) | |
| download | nng-5fb832e06fd4ded6ccc45f943837fd374a9cea7a.tar.gz nng-5fb832e06fd4ded6ccc45f943837fd374a9cea7a.tar.bz2 nng-5fb832e06fd4ded6ccc45f943837fd374a9cea7a.zip | |
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.
Diffstat (limited to 'src/platform/windows')
| -rw-r--r-- | src/platform/windows/win_ipc.c | 9 | ||||
| -rw-r--r-- | src/platform/windows/win_net.c | 3 |
2 files changed, 5 insertions, 7 deletions
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); } } |
