42 G_EXCEPTION( Error ,
"cleanup error" ) ;
45 explicit Block(
bool active =
true ) noexcept ;
50 void operator=(
const Block & ) = delete ;
51 void operator=(
Block && ) = delete ;
57 static void add(
bool (*fn)(
SignalSafe,
const char*) ,
const char * arg ) ;
63 static void atexit(
bool active =
true ) ;
71 static void block() noexcept ;
76 static
void release() noexcept ;
79 static const
char *
strdup( const
char * ) ;
83 static const
char *
strdup( const std::
string & ) ;
100G::Cleanup::Block::~Block()
A static interface for registering cleanup functions that are called when the process terminates abno...
static const char * strdup(const char *)
A strdup() function that makes it clear in the stack trace that leaks are expected.
static void atexit(bool active=true)
Ensures that the cleanup functions are also called via atexit(), in addition to abnormal-termination ...
static void release() noexcept
Releases block()ed signals.
static void add(bool(*fn)(SignalSafe, const char *), const char *arg)
Adds the given handler to the list of handlers that are to be called when the process terminates abno...
static void block() noexcept
Temporarily blocks signals until release()d.
static void init()
An optional early-initialisation function. May be called more than once.
An empty structure that is used to indicate a signal-safe, reentrant implementation.
A RAII class to temporarily block signal delivery.