v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
37
source/core/StarSignalHandler.hpp
Normal file
37
source/core/StarSignalHandler.hpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef STAR_SIGNAL_HANDLER_HPP
|
||||
#define STAR_SIGNAL_HANDLER_HPP
|
||||
|
||||
#include "StarException.hpp"
|
||||
|
||||
namespace Star {
|
||||
|
||||
STAR_STRUCT(SignalHandlerImpl);
|
||||
|
||||
// Singleton signal handler that registers handlers for segfault, fpe,
|
||||
// illegal instructions etc as well as non-fatal interrupts.
|
||||
class SignalHandler {
|
||||
public:
|
||||
SignalHandler();
|
||||
~SignalHandler();
|
||||
|
||||
// If enabled, will catch segfault, fpe, and illegal instructions and output
|
||||
// error information before dying.
|
||||
void setHandleFatal(bool handleFatal);
|
||||
bool handlingFatal() const;
|
||||
|
||||
// If enabled, non-fatal interrupt signal will be caught and will not kill
|
||||
// the process and will instead set the interrupted flag.
|
||||
void setHandleInterrupt(bool handleInterrupt);
|
||||
bool handlingInterrupt() const;
|
||||
|
||||
bool interruptCaught() const;
|
||||
|
||||
private:
|
||||
friend SignalHandlerImpl;
|
||||
|
||||
static SignalHandlerImplUPtr s_singleton;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue