refactor: extract mod exit, task; Thread -> Task

This commit is contained in:
same mf who else 2026-03-28 14:11:23 +02:00
parent bea88ac58d
commit dae4d5a140
8 changed files with 114 additions and 74 deletions

10
src/exit.rs Normal file
View file

@ -0,0 +1,10 @@
use std::sync::{Arc, atomic::AtomicBool};
use crate::Usually;
#[derive(Clone)] pub struct Exit(Arc<AtomicBool>);
impl Exit {
pub fn run <T> (run: impl Fn(Self)->Usually<T>) -> Usually<T> {
run(Self(Arc::new(AtomicBool::new(false))))
}
}