omni::application::signal_handler

SYNOPSIS

The signal_handler namespace is used to facilitate receiving system signals in the application.

top

DESCRIPTION

The signal_handler namespace contains functions and definitions that can be used to attach and detach application wide signal handlers to receive signals (like SIGABRT, SIGSEGV, or SIGINT). The signal handler function must return a void type and take a single int parameter, that is, it must adhere to the function signature of an omni::application::signal_handler::callback.

top

ERRORS

If an exception occurs on an attached delegate, it will be handled according to omni::sync::user_thread_exception and omni::sync::unhandled_thread_exception.

top

CONSIDERATIONS

This function will only have an effect if you have explicitly called one of the omni::application::run functions to block the main thread until program completion.

top

PLATFORM SPECIFIC

On Windows based platforms, this will listen for the system signal events (as described), as well as set the console control handler, which can handle other signals as well (such as the CTRL_LOGOFF_EVENT or CTRL_SHUTDOWN_EVENT).

top

NOTES

Since the signals can be raised on different threads, it's important to take care of any multi-threaded issues that might arise when using any of the signal handlers.

top