JANA2
C++ framework for multi-threaded data processing
JSignalHandler Namespace Reference

JSignalHandler bundles together the logic for querying a JApplication about its JStatus with signal handlers for USR1, USR2, and CTRL-C. More...

Functions

void handle_sigint (int)
 Handle SIGINT signals (e.g. More...
 
void handle_usr1 (int)
 
void handle_usr2 (int)
 
void handle_tstp (int)
 
void handle_sigsegv (int, siginfo_t *, void *)
 
void register_handlers (JApplication *app)
 Add special handles for system signals.
 

Variables

JApplicationg_app
 
JLoggerg_logger
 

Detailed Description

JSignalHandler bundles together the logic for querying a JApplication about its JStatus with signal handlers for USR1, USR2, and CTRL-C.

JSignalHandler attaches signal handlers for USR1, USR2, and CTRL-C to a given JApplication instance.

Function Documentation

◆ handle_sigint()

void JSignalHandler::handle_sigint ( int  )

Handle SIGINT signals (e.g.

from hitting Ctrl-C). When a SIGINT is received, JANA will try and shutdown the program cleanly, allowing the processing threads to finish up the events they are working on. The first 2 SIGINT signals received will tell JANA to shutdown gracefully. On the 3rd SIGINT, the program will try to exit immediately.

References JApplication::GetService().

Referenced by register_handlers().