Skip to main content

Module signals

Module signals 

Source
Expand description

Operating system signal handling.

Registers a Ctrl+C (SIGINT) handler that signals cancellation via a shared AtomicBool. All modules that run long operations must check is_cancelled periodically.

Functionsยง

cancellation_flag
Returns the shared cancellation flag pointer.
is_cancelled
Returns true if the user pressed Ctrl+C.
is_terminated
Returns true if the process received SIGTERM.
register_handler
Registers the Ctrl+C handler that sets the cancellation flag.
sigterm_flag
Returns the Arc of the SIGTERM flag for async tasks.