(name: &'static str, f: F)
| 439 | } |
| 440 | |
| 441 | fn run_blocking<T, F>(name: &'static str, f: F) -> Result<T> |
| 442 | where |
| 443 | T: Send + 'static, |
| 444 | F: FnOnce() -> Result<T> + Send + 'static, |
| 445 | { |
| 446 | let recorder = timing::current_recorder(); |
| 447 | thread::Builder::new() |
| 448 | .name(name.to_string()) |
| 449 | .spawn(move || timing::with_recorder(recorder, f)) |
| 450 | .with_context(|| format!("spawn {name} worker"))? |
| 451 | .join() |
| 452 | .map_err(|_| anyhow!("{name} worker panicked"))? |
| 453 | } |
| 454 | |
| 455 | #[cfg(unix)] |
| 456 | fn start_unix( |
no test coverage detected