rust/src/libstd
bors 7aab3d38a0 Auto merge of #38866 - alexcrichton:try-wait, r=aturon
std: Add a nonblocking `Child::try_wait` method

This commit adds a new method to the `Child` type in the `std::process` module
called `try_wait`. This method is the same as `wait` except that it will not
block the calling thread and instead only attempt to collect the exit status. On
Unix this means that we call `waitpid` with the `WNOHANG` flag and on Windows it
just means that we pass a 0 timeout to `WaitForSingleObject`.

Currently it's possible to build this method out of tree, but it's unfortunately
tricky to do so. Specifically on Unix you essentially lose ownership of the pid
for the process once a call to `waitpid` has succeeded. Although `Child` tracks
this state internally to be resilient to multiple calls to `wait` or a `kill`
after a successful wait, if the child is waited on externally then the state
inside of `Child` is not updated. This means that external implementations of
this method must be extra careful to essentially not use a `Child`'s methods
after a call to `waitpid` has succeeded (even in a nonblocking fashion).

By adding this functionality to the standard library it should help canonicalize
these external implementations and ensure they can continue to robustly reuse
the `Child` type from the standard library without worrying about pid ownership.
2017-01-09 07:01:10 +00:00
..
collections
ffi
io Rollup merge of #38505 - estebank:why-lines, r=frewsxcv 2016-12-24 14:29:26 -05:00
net Auto merge of #38327 - Yamakaky:into-ipaddr, r=brson 2017-01-07 09:00:52 +00:00
os sparc64-linux support 2016-12-30 20:46:19 -05:00
prelude
rand
sync
sys Auto merge of #38866 - alexcrichton:try-wait, r=aturon 2017-01-09 07:01:10 +00:00
sys_common Fix compile errors and such 2016-12-20 14:09:50 -08:00
thread Auto merge of #38548 - GuillaumeGomez:thread_struct_docs, r=frewsxcv 2017-01-01 22:45:02 +00:00
time
ascii.rs
build.rs Auto merge of #38401 - redox-os:redox_cross, r=brson 2016-12-23 09:09:26 +00:00
Cargo.toml
env.rs libstd: define std::env::consts::ARCH for sparc64 2016-12-29 21:30:01 -05:00
error.rs
f32.rs
f64.rs
fs.rs Auto merge of #38536 - retep998:flauschige-kaninchen, r=petrochenkov 2016-12-26 10:52:56 +00:00
lib.rs Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
macros.rs
memchr.rs
num.rs
panic.rs
panicking.rs
path.rs
primitive_docs.rs Make rustdoc aware of the primitive i128 type 2016-12-30 15:17:27 +01:00
process.rs Auto merge of #38866 - alexcrichton:try-wait, r=aturon 2017-01-09 07:01:10 +00:00
rt.rs Revert rt.rs 2016-12-22 16:19:05 -07:00
rtdeps.rs