Skip to main content

install_interrupt_handler

Function install_interrupt_handler 

Source
pub fn install_interrupt_handler()
Expand description

Install the process-level Ctrl-C (SIGINT) handler exactly once.

The handler only flips an atomic flag every generation/verification loop already polls through a CancellationToken, so the actual signal wiring stays minimal. On non-Unix targets this is a no-op and cancellation must be driven explicitly (e.g. CancellationToken::cancel); the atomic-flag mechanism itself is fully portable and testable regardless.