From: Junio C Hamano <gitster@pobox•com>
To: Stefan Beller <sbeller@google•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 1/5] run-command: Fix early shutdown
Date: Tue, 20 Oct 2015 11:41:19 -0700 [thread overview]
Message-ID: <xmqqa8rd8jsg.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1445279086-31066-2-git-send-email-sbeller@google.com> (Stefan Beller's message of "Mon, 19 Oct 2015 11:24:42 -0700")
Stefan Beller <sbeller@google•com> writes:
> The return value of `pp_collect_finished` indicates if we want to shutdown
> the parallel processing early. Both returns from that function should
> return any accumulated results.
>
> Signed-off-by: Stefan Beller <sbeller@google•com>
> ---
Makes sense. The code could "break" out of the loop, leaving only
one return site in the function, which would be a way to ensure that
we'd consistently return the accumulated result, but this would also
do.
Thanks.
> run-command.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/run-command.c b/run-command.c
> index ef3da27..8f47c6e 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -1077,7 +1077,7 @@ static int pp_collect_finished(struct parallel_processes *pp)
> while (pp->nr_processes > 0) {
> pid = waitpid(-1, &wait_status, WNOHANG);
> if (pid == 0)
> - return 0;
> + return result;
>
> if (pid < 0)
> die_errno("wait");
next prev parent reply other threads:[~2015-10-20 18:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 18:24 [PATCH 0/5] Fixes for the parallel processing Stefan Beller
2015-10-19 18:24 ` [PATCH 1/5] run-command: Fix early shutdown Stefan Beller
2015-10-20 18:41 ` Junio C Hamano [this message]
2015-10-19 18:24 ` [PATCH 2/5] run-command: Call get_next_task with a clean child process Stefan Beller
2015-10-20 18:49 ` Junio C Hamano
2015-10-20 19:07 ` Stefan Beller
2015-10-19 18:24 ` [PATCH 3/5] run-command: Initialize the shutdown flag Stefan Beller
2015-10-19 18:24 ` [PATCH 4/5] test-run-command: test for gracefully aborting Stefan Beller
2015-10-19 18:24 ` [PATCH 5/5] test-run-command: Increase test coverage Stefan Beller
2015-10-20 18:53 ` Junio C Hamano
2015-10-20 19:05 ` Stefan Beller
2015-10-20 17:51 ` [PATCH 6/5] run-command: Fix missing output from late callbacks Stefan Beller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa8rd8jsg.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=sbeller@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox