ProcWaitFor
Description
Block the parent process and wait for provided child process to finish execution. This will wait for given time, otherwise will continue execution to parent without closing the child process. Parent may then call terminate if they need the process to end.
Parameters
| Name | Direction | Description |
|---|---|---|
proc |
in | Child process handle to wait for. |
timeout |
in | Timeout in milliseconds, 0 for infinite wait. |
Returns
Current process status, including SYS_PROC_STATUS_ERROR when
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Proc.c:293:
}
ProcStatus ProcWaitFor(Proc *proc, u64 timeout_ms) {
if (!proc) {
LOG_FATAL("Invalid arguments");- In
SubProcComm.c:41:
// wait for program to exit for 1 second
ProcWaitFor(proc, 1000);
// finally terminate
Last updated on