MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / wait_for_process_exit

Function wait_for_process_exit

packages/server/src/main.rs:1808–1817  ·  view source on GitHub ↗
(pid: u32, timeout: Duration)

Source from the content-addressed store, hash-verified

1806}
1807
1808fn 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
1819fn process_exists(pid: u32) -> bool {
1820 ProcessCommand::new("kill")

Calls 2

process_existsFunction · 0.70
sleepFunction · 0.50

Tested by

no test coverage detected