MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / terminate_child_gracefully

Function terminate_child_gracefully

xtask/src/main.rs:3498–3519  ·  view source on GitHub ↗
(child: &mut Child)

Source from the content-addressed store, hash-verified

3496}
3497
3498fn terminate_child_gracefully(child: &mut Child) {
3499 #[cfg(unix)]
3500 {
3501 let _ = Command::new("kill")
3502 .arg("-TERM")
3503 .arg(child.id().to_string())
3504 .stdout(Stdio::null())
3505 .stderr(Stdio::null())
3506 .status();
3507 let started = Instant::now();
3508 while started.elapsed() < Duration::from_secs(5) {
3509 if child.try_wait().ok().flatten().is_some() {
3510 return;
3511 }
3512 std::thread::sleep(Duration::from_millis(25));
3513 }
3514 }
3515 #[cfg(not(unix))]
3516 {
3517 let _ = child;
3518 }
3519}
3520
3521fn perf_diagnose_indexed_update() -> Result<()> {
3522 Pglite::preload()?;

Callers 1

dropMethod · 0.85

Calls 4

statusMethod · 0.80
argMethod · 0.80
idMethod · 0.80
elapsedMethod · 0.80

Tested by

no test coverage detected