diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-10-20 08:51:21 +0200 |
|---|---|---|
| committer | Jonathan Marler <johnnymarler@gmail.com> | 2021-06-17 17:39:32 -0600 |
| commit | 34c00ecf57a50e19b31fce420044311c4f2e9c7a (patch) | |
| tree | 4e12d9cbd5de56979506d1f14050adde2722231b /lib/std/Thread | |
| parent | 6f0cfdb8206026f239ca079a9f3eebae20bd5310 (diff) | |
| download | zig-34c00ecf57a50e19b31fce420044311c4f2e9c7a.tar.gz zig-34c00ecf57a50e19b31fce420044311c4f2e9c7a.zip | |
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.
Diffstat (limited to 'lib/std/Thread')
0 files changed, 0 insertions, 0 deletions
