We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73b97dc commit 2d3c3f7Copy full SHA for 2d3c3f7
1 file changed
Lib/subprocess.py
@@ -2136,12 +2136,17 @@ def _busy_wait(self, timeout):
2136
time.sleep(delay)
2137
2138
def _wait(self, timeout):
2139
- """Internal implementation of wait() on POSIX."""
+ """Internal implementation of wait() on POSIX.
2140
+
2141
+ Uses efficient pidfd_open() + poll() on Linux or kqueue()
2142
+ on macOS/BSD when available. Falls back to polling
2143
+ waitpid(WNOHANG) otherwise.
2144
+ """
2145
if self.returncode is not None:
2146
return self.returncode
2147
2148
if timeout is not None:
- # Try fast wait first (pidfd on Linux, kqueue on BSD/macOS).
2149
+ # Try efficient wait first.
2150
if self._wait_pidfd(timeout) or self._wait_kqueue(timeout):
2151
with self._waitpid_lock:
2152
0 commit comments