|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
RAII wrapper for temporarily blocking signals. More...
#include <ah-signal.H>
Public Member Functions | |
| SignalBlocker (const SignalSet &signals) | |
| Blocks the signals in the given set. | |
| SignalBlocker (std::initializer_list< int > signals) | |
| Blocks the signals specified in the initializer list. | |
| SignalBlocker (int signo) | |
| Blocks a single signal. | |
| ~SignalBlocker () | |
| Restores the previous signal mask. | |
| void | release () noexcept |
| Releases ownership - the mask won't be restored on destruction. | |
| const sigset_t & | previous_mask () const noexcept |
| Returns the previous signal mask that will be restored. | |
| SignalBlocker (const SignalBlocker &)=delete | |
| SignalBlocker & | operator= (const SignalBlocker &)=delete |
| SignalBlocker (SignalBlocker &&other) noexcept | |
| SignalBlocker & | operator= (SignalBlocker &&other) noexcept |
Private Attributes | |
| sigset_t | old_mask_ |
| bool | active_ = true |
RAII wrapper for temporarily blocking signals.
Blocks the specified signals on construction and restores the previous signal mask on destruction.
sigprocmask() which affects the calling thread in single-threaded programs or the process signal mask. Definition at line 232 of file ah-signal.H.
|
inlineexplicit |
Blocks the signals in the given set.
| signals | The set of signals to block. |
| SignalError | if sigprocmask fails. |
Definition at line 243 of file ah-signal.H.
References SignalSet::get(), and old_mask_.
|
inline |
Blocks the signals specified in the initializer list.
| signals | List of signal numbers to block. |
| SignalError | if sigprocmask fails. |
Definition at line 254 of file ah-signal.H.
|
inlineexplicit |
Blocks a single signal.
| signo | The signal number to block. |
| SignalError | if sigprocmask fails. |
Definition at line 262 of file ah-signal.H.
|
inline |
Restores the previous signal mask.
Definition at line 266 of file ah-signal.H.
|
delete |
|
inlinenoexcept |
Definition at line 286 of file ah-signal.H.
|
delete |
|
inlinenoexcept |
Definition at line 292 of file ah-signal.H.
|
inlinenoexcept |
Returns the previous signal mask that will be restored.
Definition at line 276 of file ah-signal.H.
References old_mask_.
|
inlinenoexcept |
Releases ownership - the mask won't be restored on destruction.
Definition at line 273 of file ah-signal.H.
References active_.
Referenced by TEST_F().
|
private |
Definition at line 235 of file ah-signal.H.
Referenced by ~SignalBlocker(), operator=(), and release().
|
private |
Definition at line 234 of file ah-signal.H.
Referenced by SignalBlocker(), ~SignalBlocker(), operator=(), and previous_mask().