will_exit 0.1.2

work on program will exit
docs.rs failed to build will_exit-0.1.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: will_exit-0.3.3

will_exit

Usage

use core::time::Duration;
use std::thread;

fn main() {
    will_exit::init().unwrap();
    thread::spawn(|| {
        thread::sleep(Duration::from_secs(6));
        will_exit::exit();
    });
    loop {
        if will_exit::will_exit() {
            break;
        }
        thread::sleep(Duration::from_millis(100));
    }
    println!("exit");
}