mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
std: Avoid deadlocking in ChildProcess.exec
Reading stdin&stderr at different times may lead to nasty deadlocks (eg. when stdout is read before stderr and the child process doesn't write anything onto stdout). Implement a polling mechanism to make sure this won't happen: we read data from stderr/stdout as it becomes ready and then it's copied into an ArrayList provided by the user, avoiding any kind of blocking read.
This commit is contained in:
parent
1590ed9d6a
commit
dc810eb73b
3 changed files with 208 additions and 11 deletions
Loading…
Add table
Add a link
Reference in a new issue