D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20257 - Implement waitTimeout() in std.process
Summary: Implement waitTimeout() in std.process
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-02 01:27 UTC by Andrej Mitrovic
Modified: 2022-07-04 17:02 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2019-10-02 01:27:59 UTC
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 Dlang Bot 2020-06-12 11:01:42 UTC
@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 Dlang Bot 2021-04-26 15:37:12 UTC
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 Andrej Mitrovic 2022-07-04 17:02:14 UTC
Marking this as resolved as I originally only requested this for win32. It seems like nobody else is missing it on other platforms.