#include <signal_blocker.h>
Definition at line 20 of file signal_blocker.h.
◆ ThreadSignalBlocker() [1/2]
dart::ThreadSignalBlocker::ThreadSignalBlocker |
( |
int |
sig | ) |
|
|
inlineexplicit |
Definition at line 22 of file signal_blocker.h.
22 {
23 sigset_t signal_mask;
24 sigemptyset(&signal_mask);
25 sigaddset(&signal_mask, sig);
26
27 int r = pthread_sigmask(SIG_BLOCK, &signal_mask, &old);
30 }
◆ ThreadSignalBlocker() [2/2]
dart::ThreadSignalBlocker::ThreadSignalBlocker |
( |
int |
sigs_count, |
|
|
const int |
sigs[] |
|
) |
| |
|
inline |
Definition at line 32 of file signal_blocker.h.
32 {
33 sigset_t signal_mask;
34 sigemptyset(&signal_mask);
35 for (
int i = 0;
i < sigs_count;
i++) {
36 sigaddset(&signal_mask, sigs[
i]);
37 }
38
39 int r = pthread_sigmask(SIG_BLOCK, &signal_mask, &old);
42 }
◆ ~ThreadSignalBlocker()
dart::ThreadSignalBlocker::~ThreadSignalBlocker |
( |
| ) |
|
|
inline |
Definition at line 44 of file signal_blocker.h.
44 {
45
46 int r = pthread_sigmask(SIG_SETMASK, &old, nullptr);
49 }
The documentation for this class was generated from the following file: