(pid: u32, timeout: Duration)
| 563 | } |
| 564 | |
| 565 | fn wait_for_process_exit(pid: u32, timeout: Duration) -> bool { |
| 566 | let deadline = Instant::now() + timeout; |
| 567 | while Instant::now() < deadline { |
| 568 | if !process_exists(pid) { |
| 569 | return true; |
| 570 | } |
| 571 | thread::sleep(Duration::from_millis(50)); |
| 572 | } |
| 573 | !process_exists(pid) |
| 574 | } |
| 575 | |
| 576 | fn process_exists(pid: u32) -> bool { |
| 577 | Command::new("kill") |
no test coverage detected