Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: runtime/bin/signal_blocker.h

Issue 108003009: Signal handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/signal_blocker.h
diff --git a/runtime/bin/signal_blocker.h b/runtime/bin/signal_blocker.h
index e91edd9fe71b7c64cb2ae999c6437b66fcf3fe77..9dc957df9aec6c084c3e4fe2c850f454cdeeb388 100644
--- a/runtime/bin/signal_blocker.h
+++ b/runtime/bin/signal_blocker.h
@@ -27,6 +27,17 @@ class ThreadSignalBlocker {
ASSERT(r == 0);
}
+ ThreadSignalBlocker(int sigs_count, const int sigs[]) {
+ sigset_t signal_mask;
+ sigemptyset(&signal_mask);
+ for (int i = 0; i < sigs_count; i++) {
+ sigaddset(&signal_mask, sigs[i]);
+ }
+ // Add sig to signal mask.
+ int r = pthread_sigmask(SIG_BLOCK, &signal_mask, &old);
Søren Gjesse 2013/12/18 08:07:14 You will probably need USE(r) for release mode.
Anders Johnsen 2013/12/18 21:20:29 Done.
+ ASSERT(r == 0);
+ }
+
~ThreadSignalBlocker() {
// Restore signal mask.
int r = pthread_sigmask(SIG_SETMASK, &old, NULL);

Powered by Google App Engine
This is Rietveld 408576698