Merge pull request #1172 from rockorager/delay_syscall

termio: delay repeated `waitpid` syscalls when killing children
This commit is contained in:
Mitchell Hashimoto
2023-12-28 09:16:17 -08:00
committed by GitHub

View File

@ -1179,6 +1179,7 @@ const Subprocess = struct {
// kill them again. // kill them again.
const res = std.os.waitpid(pid, std.c.W.NOHANG); const res = std.os.waitpid(pid, std.c.W.NOHANG);
if (res.pid != 0) break; if (res.pid != 0) break;
std.time.sleep(10 * std.time.ns_per_ms);
} }
}, },
} }