#include <SignalHandlers.h>
Public Types | |
| enum class | Type |
Public Member Functions | |
| SignalHandler ()=delete | |
| nonvirtual void | operator() (SignalID i) const |
| nonvirtual strong_ordering | operator<=> (const SignalHandler &rhs) const |
| Each SignalHandler constructed is its own, kept by its copies: another made the same way - even from the same function - is not equal to it. So to remove one, keep the one added. | |
| nonvirtual bool | operator== (const SignalHandler &rhs) const |
| True only for the same SignalHandler, or a copy of it -. | |
A key feature of SignalHandler versus function<void(SignalID)> is that you can compare them
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) does not compare 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.
Definition at line 72 of file SignalHandlers.h.
|
strong |
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.
Definition at line 85 of file SignalHandlers.h.
|
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).
| void Stroika::Foundation::Execution::SignalHandler::operator() | ( | SignalID | i | ) | const |
Invoke the actual signal handler.
Definition at line 36 of file SignalHandlers.inl.
| bool Stroika::Foundation::Execution::SignalHandler::operator== | ( | const SignalHandler & | rhs | ) | const |
True only for the same SignalHandler, or a copy of it -.
Definition at line 47 of file SignalHandlers.inl.