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

Function run_blocking

src/pglite/server.rs:441–453  ·  view source on GitHub ↗
(name: &'static str, f: F)

Source from the content-addressed store, hash-verified

439}
440
441fn run_blocking<T, F>(name: &'static str, f: F) -> Result<T>
442where
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)]
456fn start_unix(

Callers 1

startMethod · 0.85

Calls 4

current_recorderFunction · 0.85
with_recorderFunction · 0.85
joinMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected