equal
deleted
inserted
replaced
613 # chg since the parent process won't die anytime soon. |
613 # chg since the parent process won't die anytime soon. |
614 # We use a thread to make the overhead tiny. |
614 # We use a thread to make the overhead tiny. |
615 def _do_wait(): |
615 def _do_wait(): |
616 os.waitpid(pid, 0) |
616 os.waitpid(pid, 0) |
617 |
617 |
618 threading.Thread(target=_do_wait, daemon=True).start() |
618 t = threading.Thread(target=_do_wait) |
|
619 t.daemon = True |
|
620 t.start() |
619 return |
621 return |
620 # Parent process |
622 # Parent process |
621 (_pid, status) = os.waitpid(pid, 0) |
623 (_pid, status) = os.waitpid(pid, 0) |
622 if os.WIFEXITED(status): |
624 if os.WIFEXITED(status): |
623 returncode = os.WEXITSTATUS(status) |
625 returncode = os.WEXITSTATUS(status) |