Function git_repository::interrupt::init_handler[][src]

pub fn init_handler(
    interrupt: impl Fn() + Send + Sync + Clone + 'static
) -> Result<()>
Expand description

Initialize a signal handler to listen to SIGINT and SIGTERM and trigger our trigger() that way. Also trigger interrupt() which promises to never use a Mutex, allocate or deallocate.

Note

It will abort the process on second press and won’t inform the user about this behaviour either as we are unable to do so without deadlocking even when trying to write to stderr directly.