Merge lp:~marcustomlinson/process-cpp/set_mask_on_restore into lp:process-cpp

Proposed by Marcus Tomlinson
Status: Needs review
Proposed branch: lp:~marcustomlinson/process-cpp/set_mask_on_restore
Merge into: lp:process-cpp
Diff against target: 38 lines (+12/-2)
1 file modified
src/core/posix/signal.cpp (+12/-2)
To merge this branch: bzr merge lp:~marcustomlinson/process-cpp/set_mask_on_restore
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Thomas Voß Pending
Review via email: mp+230059@code.launchpad.net

Commit message

Use SIG_BLOCK when adding to the signal mask, and SIG_SETMASK when restoring the old mask.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

55. By Marcus Tomlinson

Use SIG_BLOCK when adding to the signal mask, and SIG_SETMASK when restoring the old mask.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/posix/signal.cpp'
2--- src/core/posix/signal.cpp 2014-03-25 13:23:46 +0000
3+++ src/core/posix/signal.cpp 2014-08-08 08:01:25 +0000
4@@ -31,11 +31,21 @@
5 {
6 void set_thread_signal_mask(::sigset_t* new_mask, ::sigset_t* old_mask)
7 {
8+ ::pthread_sigmask(SIG_SETMASK, new_mask, old_mask);
9+}
10+
11+void add_thread_signal_mask(::sigset_t* new_mask, ::sigset_t* old_mask)
12+{
13 ::pthread_sigmask(SIG_BLOCK, new_mask, old_mask);
14 }
15
16 void set_process_signal_mask(::sigset_t* new_mask, ::sigset_t* old_mask)
17 {
18+ ::sigprocmask(SIG_SETMASK, new_mask, old_mask);
19+}
20+
21+void add_process_signal_mask(::sigset_t* new_mask, ::sigset_t* old_mask)
22+{
23 ::sigprocmask(SIG_BLOCK, new_mask, old_mask);
24 }
25
26@@ -70,10 +80,10 @@
27 switch (scope)
28 {
29 case Scope::process:
30- set_process_signal_mask(&blocked_signals_mask, &old_signals_mask);
31+ add_process_signal_mask(&blocked_signals_mask, &old_signals_mask);
32 break;
33 case Scope::thread:
34- set_thread_signal_mask(&blocked_signals_mask, &old_signals_mask);
35+ add_thread_signal_mask(&blocked_signals_mask, &old_signals_mask);
36 break;
37 }
38 }

Subscribers

People subscribed via source and target branches