Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::SignalHandler Class Reference

#include <SignalHandlers.h>

Public Types

enum class  Type
 

Public Member Functions

 SignalHandler ()=delete
 
nonvirtual void operator() (SignalID i) const
 

Detailed Description

A key feature of SignalHandler versus function<void(SignalID)> is that you can compare them (

See also
Function)

Note that to do so, you must save the original SignalHandler you create to later remove it by value: creating another SignalHandler (even with the same arguments) may not compare as equal.

Also, signal handlers come with a flag indicating that they are intended to be run in a 'safe' manner or a direct signal handling manner.

Note
BEWARE - these may be copied during invocation, which for 'direct' signal handers is a dangerous, finicky place. Copy must not do operations (like allocate memory) which would be unsafe during signal (direct) handling.

Definition at line 71 of file SignalHandlers.h.

Member Enumeration Documentation

◆ Type

A direct (eDirect) signal handler is invoked in the stack context in which the signal is delivered. Direct signal handlers are VERY UNSAFE and use carefully, since they can EASILY produce deadlocks.

A 'safe' (eSafe) signal handler is run in a separate thread context.

See also
SignalHandlerRegistry::SafeSignalsManager.
Note
Common::DefaultNames<> supported

Definition at line 84 of file SignalHandlers.h.

Constructor & Destructor Documentation

◆ SignalHandler()

Stroika::Foundation::Execution::SignalHandler::SignalHandler ( )
delete

Any overload can be used for safe exception handlers, but only the noexcept overload may be used for 'direct' exception calls (as a documentation hint - no real need).

Note
https://stackoverflow.com/questions/38760784/how-will-c17-exception-specifier-type-system-work and the existing compiler vs2k17 15.9.3 - dont support this noexcept on function objects, so try again later.

Member Function Documentation

◆ operator()()

void Stroika::Foundation::Execution::SignalHandler::operator() ( SignalID  i) const

Invoke the actual signal handler.

Definition at line 36 of file SignalHandlers.inl.


The documentation for this class was generated from the following files: