changeset 30412 | 7bc25549e084 |
parent 30411 | 47de34f79f93 |
child 30413 | 9c25a1a8c685 |
--- a/mercurial/worker.py Thu Jul 28 20:51:20 2016 +0100 +++ b/mercurial/worker.py Thu Jul 28 20:57:07 2016 +0100 @@ -97,9 +97,11 @@ except OSError as err: if err.errno != errno.ESRCH: raise - def waitforworkers(): + def waitforworkers(blocking=True): for pid in pids: - st = _exitstatus(os.waitpid(pid, 0)[1]) + p, st = os.waitpid(pid, 0 if blocking else os.WNOHANG) + if p: + st = _exitstatus(st) if st and not problem[0]: problem[0] = st killworkers()