Bug 20257 – Implement waitTimeout() in std.process

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2019-10-02T01:27:59Z
Last change time
2022-07-04T17:02:14Z
Assigned to
No Owner
Creator
Andrej Mitrovic

Comments

Comment #0 by andrej.mitrovich — 2019-10-02T01:27:59Z
Currently wait() is blocking, while tryWait() would have to be used in a loop in order to simulate waiting until a timeout is reached. It would be great if waitTimeout(Pid, Duration) was provided as an API.
Comment #1 by dlang-bot — 2020-06-12T11:01:42Z
@MoonlightSentinel created dlang/phobos pull request #7528 "Issue 20257 - Add wait(Pid, Duration) for windows" mentioning this issue: - Issue 20257 - Add wait(Pid, Duration) for windows `wait(Pid, Duration)` allows to wait until the process terminates or the timeout expires. It's currently windows-only because a decent posix implementation is quite difficult and this allows us to sort out the API beforehand. https://github.com/dlang/phobos/pull/7528
Comment #2 by dlang-bot — 2021-04-26T15:37:12Z
dlang/phobos pull request #7528 "Issue 20257 - Add wait(Pid, Duration) for windows" was merged into master: - 0317d1d63b625d69c35060a6108ded418eab8815 by MoonlightSentinel: Issue 20257 - Add wait(Pid, Duration) for windows `wait(Pid, Duration)` allows to wait until the process terminates or the timeout expires. It's currently windows-only because a decent posix implementation is quite difficult and this allows us to sort out the API beforehand. https://github.com/dlang/phobos/pull/7528
Comment #3 by andrej.mitrovich — 2022-07-04T17:02:14Z
Marking this as resolved as I originally only requested this for win32. It seems like nobody else is missing it on other platforms.