libexcept 1.1.19
Stack trace along C++ exceptions
Public Types | Public Member Functions | Private Attributes | List of all members
libexcept::scoped_signal_mask Class Reference

#include <scoped_signal_mask.h>

Public Types

typedef std::shared_ptr< scoped_signal_maskpointer_t
 

Public Member Functions

 scoped_signal_mask (sig_list_t block_signals=sig_list_t())
 Set signal mask.
 
 ~scoped_signal_mask ()
 Reset signal mask the way it was before the constructor was called.
 

Private Attributes

sigset_t f_original_mask = sigset_t()
 
bool f_set = false
 

Detailed Description

Definition at line 52 of file scoped_signal_mask.h.

Member Typedef Documentation

◆ pointer_t

Definition at line 55 of file scoped_signal_mask.h.

Constructor & Destructor Documentation

◆ scoped_signal_mask()

libexcept::scoped_signal_mask::scoped_signal_mask ( sig_list_t  block_signals = sig_list_t())

This constructor blocks the specified block_signals and the destructor restores the flags as expected once the object is out of scope.

If the block_signals list is empty, then all the signals get blocked. This is particularly useful to start a new thread.

Parameters
[in]block_signalsThe list of signals to block or empty to block them all.

Definition at line 94 of file scoped_signal_mask.cpp.

References f_original_mask, f_set, and libexcept::has_sanitizer().

◆ ~scoped_signal_mask()

libexcept::scoped_signal_mask::~scoped_signal_mask ( )

This function restores the signals as they were before the scoped_signal_mask was created.

Definition at line 142 of file scoped_signal_mask.cpp.

References f_original_mask, and f_set.

Member Data Documentation

◆ f_original_mask

sigset_t libexcept::scoped_signal_mask::f_original_mask = sigset_t()
private

Definition at line 62 of file scoped_signal_mask.h.

Referenced by scoped_signal_mask(), and ~scoped_signal_mask().

◆ f_set

bool libexcept::scoped_signal_mask::f_set = false
private

Definition at line 61 of file scoped_signal_mask.h.

Referenced by scoped_signal_mask(), and ~scoped_signal_mask().


The documentation for this class was generated from the following files:

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.