diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-07 00:56:31 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-07 00:56:31 -0800 |
| commit | b21a0bf8eb88ae47e1b8e85731ae9afb37988d61 (patch) | |
| tree | 0269186d75f00348d6ab7c490b7f2987cb7f629a /src/protocol | |
| parent | 0f9d86fe6931fd2e84651edb046930b62b590df3 (diff) | |
| download | nng-b21a0bf8eb88ae47e1b8e85731ae9afb37988d61.tar.gz nng-b21a0bf8eb88ae47e1b8e85731ae9afb37988d61.tar.bz2 nng-b21a0bf8eb88ae47e1b8e85731ae9afb37988d61.zip | |
Pipeline fixes.
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/pipeline/push.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/protocol/pipeline/push.c b/src/protocol/pipeline/push.c index 10c0ddf9..de774125 100644 --- a/src/protocol/pipeline/push.c +++ b/src/protocol/pipeline/push.c @@ -66,6 +66,7 @@ nni_push_init(void **pushp, nni_sock *sock) push->raw = 0; push->npipes = 0; push->wantw = 0; + push->nextpipe = NULL; push->uwq = nni_sock_sendq(sock); *pushp = push; nni_sock_recverr(sock, NNG_ENOTSUP); @@ -143,12 +144,11 @@ nni_push_pipe_add(void *arg) } // Wake the sender since we have a new pipe. nni_mtx_lock(&push->mx); - if (push->nextpipe) { - // Inject us right before the next pipe, so that we're next. - nni_list_insert_before(&push->pipes, pp, push); - } else { - nni_list_append(&push->pipes, pp); - } + + // Turns out it should not really matter where we stick this. + // The end makes our test cases easier. + nni_list_append(&push->pipes, pp); + // Wake the top sender, as we can accept a job. push->npipes++; nni_cv_wake(&push->cv); |
