pub fn register_double_ctrlc_kill() -> std::io::Result<()> {
    // Make sure double CTRL+C and similar kills
    let term_now = Arc::new(AtomicBool::new(false));
    for sig in TERM_SIGNALS {
        // When terminated by a second term signal, exit with exit code 1.
        // This will do nothing the first time (because term_now is false).
        flag::register_conditional_shutdown(*sig, 1, Arc::clone(&term_now))?;
        // But this will "arm" the above for the second time, by setting it to true.
        // The order of registering these is important, if you put this one first, it
        // will first arm and then terminate ‒ all in the first round.
        flag::register(*sig, Arc::clone(&term_now))?;
    }

    Ok(())
}
/// If this functino succeeds, sending two SIGINT (Ctrl+C in most terminals)
/// will terminate the process. This function should often be the first function
/// called from your main file, especially if you are registering some sort of
/// signal handling within your manager's definition.
///
/// If you use [crate::manager::process_pool::ProcessPool], it is highly
/// advisable you also call `register_double_ctrlc_kill` since the [ProcessPool]
/// installs its own signal handler and, hence, if something goes wrong over
/// there, the signals can be ignored.
If this functino succeeds, sending two SIGINT (Ctrl+C in most terminals)
will terminate the process. This function should often be the first function
called from your main file, especially if you are registering some sort of
signal handling within your manager's definition.


If this functino succeeds sending two SIGINT ( Ctrl + C in most terminals ) will terminate the process . This function should often be the first function called from your main file especially if you are registering some sort of signal handling within your manager ' s definition .
pub fn register_double_ctrlc_kill() -> std::io::Result<()> {
    // Make sure double CTRL+C and similar kills
    let term_now = Arc::new(AtomicBool::new(false));
    for sig in TERM_SIGNALS {
        // When terminated by a second term signal, exit with exit code 1.
        // This will do nothing the first time (because term_now is false).
        flag::register_conditional_shutdown(*sig, 1, Arc::clone(&term_now))?;
        // But this will "arm" the above for the second time, by setting it to true.
        // The order of registering these is important, if you put this one first, it
        // will first arm and then terminate ‒ all in the first round.
        flag::register(*sig, Arc::clone(&term_now))?;
    }
    Ok(())
}
pub fn register_double_ctrlc_kill ( ) -> std :: io :: Result < ( ) > { // Make sure double CTRL+C and similar kills let term_now = Arc :: new ( AtomicBool :: new ( false ) ) ; for sig in TERM_SIGNALS { // When terminated by a second term signal, exit with exit code 1. // This will do nothing the first time (because term_now is false). flag :: register_conditional_shutdown ( * sig , 1 , Arc :: clone ( & term_now ) ) ? ; // But this will "arm" the above for the second time, by setting it to true. // The order of registering these is important, if you put this one first, it // will first arm and then terminate ‒ all in the first round. flag :: register ( * sig , Arc :: clone ( & term_now ) ) ? ; } Ok ( ( ) ) }
If this functino succeeds, sending two SIGINT (Ctrl+C in most terminals)
will terminate the process.
If this functino succeeds sending two SIGINT ( Ctrl + C in most terminals ) will terminate the process .