(pid: u32, timeout: Duration)
| 1806 | } |
| 1807 | |
| 1808 | fn wait_for_process_exit(pid: u32, timeout: Duration) -> bool { |
| 1809 | let deadline = Instant::now() + timeout; |
| 1810 | while Instant::now() < deadline { |
| 1811 | if !process_exists(pid) { |
| 1812 | return true; |
| 1813 | } |
| 1814 | std::thread::sleep(Duration::from_millis(50)); |
| 1815 | } |
| 1816 | !process_exists(pid) |
| 1817 | } |
| 1818 | |
| 1819 | fn process_exists(pid: u32) -> bool { |
| 1820 | ProcessCommand::new("kill") |
no test coverage detected