diff options
| author | bwarsaw | 2000-06-23 04:37:26 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-06-23 04:37:26 +0000 |
| commit | f80ab9614e6b371df8f9bf7584049ec60916ee08 (patch) | |
| tree | cc3ee292e980c6ae85be6243cd1af2c6037df7e1 /Mailman/Utils.py | |
| parent | a9a58042b6ac54e0d2d57882efdce7cd26123ccd (diff) | |
| download | mailman-f80ab9614e6b371df8f9bf7584049ec60916ee08.tar.gz mailman-f80ab9614e6b371df8f9bf7584049ec60916ee08.tar.zst mailman-f80ab9614e6b371df8f9bf7584049ec60916ee08.zip | |
reap(): Added optional argument `func' which, if supplied, is a
function to call with no arguments, every time through the while
loop. This lets callers, e.g. keep a lock fresh while waiting for all
the children to finish.
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 77f8bb669..7d15b79f3 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -597,8 +597,10 @@ def GetRequestURI(fallback=None): # Wait on a dictionary of child pids -def reap(kids): +def reap(kids, func=None): while kids: + if func: + func() pid, status = os.waitpid(-1, os.WNOHANG) if pid <> 0: try: |
