xentara-utils v2.0.4
The Xentara Utility Library
Loading...
Searching...
No Matches
xentara::utils::posix::SignalBlocker Class Referencefinal

Helper class to temporarily block all signals. More...

#include <xentara/utils/posix/SignalBlocker.hpp>

+ Inheritance diagram for xentara::utils::posix::SignalBlocker:

Public Member Functions

 SignalBlocker ()
 Constructor.
 
 SignalBlocker (const sigset_t &signalMask)
 Constructor that sets a specific signal mask.
 
 ~SignalBlocker ()
 Constructor.
 

Detailed Description

Helper class to temporarily block all signals.

This class can be used to temporarily disable all signal on the current thread. This simplifies code that might have to deal with interrupted system calls (EINTR).

Note
This class is not available under Windows

Constructor & Destructor Documentation

◆ SignalBlocker() [1/2]

xentara::utils::posix::SignalBlocker::SignalBlocker ( )

Constructor.

This constructor blocks all blockable signals for the calling thread.

◆ SignalBlocker() [2/2]

xentara::utils::posix::SignalBlocker::SignalBlocker ( const sigset_t &  signalMask)

Constructor that sets a specific signal mask.

This constructor sets the signal mask of the current thread to the given mask.

Parameters
signalMaskThe desired signal mask.

◆ ~SignalBlocker()

xentara::utils::posix::SignalBlocker::~SignalBlocker ( )

Constructor.

This destructor restores the original signal mask.