MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / add_ctrlc_handler

Function add_ctrlc_handler

hail-fuzz/src/config.rs:264–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

262}
263
264pub fn add_ctrlc_handler() -> Arc<AtomicBool> {
265 let flag = Arc::new(AtomicBool::new(false));
266 {
267 let flag = flag.clone();
268 ctrlc::set_handler(move || {
269 if flag.swap(true, std::sync::atomic::Ordering::Relaxed) {
270 eprintln!("ctrl+c: cancel already attempted, exiting now...");
271 std::process::exit(-1);
272 }
273 })
274 .unwrap();
275 }
276 flag
277}

Callers 1

runFunction · 0.85

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected