MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / wait_for_process_exit

Function wait_for_process_exit

packages/server/src/service.rs:565–574  ·  view source on GitHub ↗
(pid: u32, timeout: Duration)

Source from the content-addressed store, hash-verified

563}
564
565fn 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
576fn process_exists(pid: u32) -> bool {
577 Command::new("kill")

Callers 1

terminate_process_groupFunction · 0.70

Calls 2

process_existsFunction · 0.70
sleepFunction · 0.50

Tested by

no test coverage detected