about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-05 16:58:42 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-13 17:27:42 -0700
commitf09592a5d154177f0c9d739c9fe60742ec4cd951 (patch)
tree79540b4f5f7e125a260b9ca00f25e796241425f9 /src/rustllvm/RustWrapper.cpp
parent9f7caed2024268f6de16f99b6696d191f3ca3228 (diff)
downloadrust-f09592a5d154177f0c9d739c9fe60742ec4cd951.tar.gz
rust-f09592a5d154177f0c9d739c9fe60742ec4cd951.zip
io: Implement process wait timeouts
This implements set_timeout() for std::io::Process which will affect wait()
operations on the process. This follows the same pattern as the rest of the
timeouts emerging in std::io::net.

The implementation was super easy for everything except libnative on unix
(backwards from usual!), which required a good bit of signal handling. There's a
doc comment explaining the strategy in libnative. Internally, this also required
refactoring the "helper thread" implementation used by libnative to allow for an
extra helper thread (not just the timer).

This is a breaking change in terms of the io::Process API. It is now possible
for wait() to fail, and subsequently wait_with_output(). These two functions now
return IoResult<T> due to the fact that they can time out.

Additionally, the wait_with_output() function has moved from taking `&mut self`
to taking `self`. If a timeout occurs while waiting with output, the semantics
are undesirable in almost all cases if attempting to re-wait on the process.
Equivalent functionality can still be achieved by dealing with the output
handles manually.

[breaking-change]

cc #13523
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions