Example:
auto proc1 = new Process(1234);
auto proc2 = new Process(5678);
Process[] gone;
Process[] alive;
bool allTerminated = waitProcs([proc1, proc2], 5.seconds, gone, alive);bool waitProcs(Process[] procs, Duration timeout = Duration.max,
out Process[] gone, out Process[] alive) @safeWaits for multiple processes to terminate.
This function waits for a collection of processes to terminate, with an optional timeout.
procs | Array of Process objects to wait for. |
timeout | Maximum duration to wait (default is infinite). |
gone | Output parameter for processes that have terminated. |
alive | Output parameter for processes that are still running. |
Example:
auto proc1 = new Process(1234);
auto proc2 = new Process(5678);
Process[] gone;
Process[] alive;
bool allTerminated = waitProcs([proc1, proc2], 5.seconds, gone, alive);