Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches

◆ CtrlCHandler() [2/2]

Ice::CtrlCHandler::CtrlCHandler ( CtrlCHandlerCallback cb)
explicit

Constructs a CtrlCHandler.

Only one instance of this class can exist in a program at any point in time. On Linux and macOS, this constructor masks the SIGHUP, SIGINT and SIGTERM signals and then creates a thread that waits for these signals using sigwait. On Windows, this constructor calls SetConsoleCtrlCHandler to register a handler routine that calls the supplied callback function.

Parameters
cbThe callback function to invoke when a signal is received.