All callers to this function MUST hold self._waitpid_lock.
(self, wait_flags)
| 2090 | |
| 2091 | |
| 2092 | def _try_wait(self, wait_flags): |
| 2093 | """All callers to this function MUST hold self._waitpid_lock.""" |
| 2094 | try: |
| 2095 | (pid, sts) = os.waitpid(self.pid, wait_flags) |
| 2096 | except ChildProcessError: |
| 2097 | # This happens if SIGCLD is set to be ignored or waiting |
| 2098 | # for child processes has otherwise been disabled for our |
| 2099 | # process. This child is dead, we can't get the status. |
| 2100 | pid = self.pid |
| 2101 | sts = 0 |
| 2102 | return (pid, sts) |
| 2103 | |
| 2104 | def _wait_pidfd(self, timeout): |
| 2105 | """Wait for PID to terminate using pidfd_open() + poll(). |