[PATCH 3 of 5 STABLE V2] worker: allow waitforworkers to be non-blocking

Yuya Nishihara youjah at gmail.com
Thu Feb 23 03:30:35 UTC 2017


On Jul 29, 2016 11:21 PM, "Yuya Nishihara" <yuya at tcha.org> wrote:

On Thu, 28 Jul 2016 21:50:06 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1469735827 -3600
> #      Thu Jul 28 20:57:07 2016 +0100
> # Node ID 57c3b5c1b41333faa4062720ae50bf93c187ce88
> # Parent  644e4dfd02fa16e77e550113cafe4fca3d0a9c69
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r
57c3b5c1b413
> worker: allow waitforworkers to be non-blocking
>
> This patch adds a boolean flag to waitforworkers and makes it non-blocking
> if set to True.
>
> This is to make it possible that we can reap our workers while keep other
> unrelated children untouched, after receiving SIGCHLD.
>
> diff --git a/mercurial/worker.py b/mercurial/worker.py

>              if st and not problem[0]:
>                  problem[0] = st

I'm not sure if st == 0 is guaranteed when p == 0, but Python appears to
initialize *wstatus to 0.


Actually this wasn't guaranteed. Foozy found st had arbitrary value
on some BSD systems.

We'll need to test p != 0.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170223/1c5d4648/attachment.html>


More information about the Mercurial-devel mailing list