Catch additional OOME in ThreadStress.
And use pthread_sigmask() instead of sigprocmask() because
the latter is unspecified in a multithreaded process.
Bug: 27371304
Change-Id: Ia511ff62d38c0fcd985421442e506cdc5f8f30bf
diff --git a/runtime/signal_set.h b/runtime/signal_set.h
index c272514..6f88852 100644
--- a/runtime/signal_set.h
+++ b/runtime/signal_set.h
@@ -38,8 +38,8 @@
}
void Block() {
- if (sigprocmask(SIG_BLOCK, &set_, nullptr) == -1) {
- PLOG(FATAL) << "sigprocmask failed";
+ if (pthread_sigmask(SIG_BLOCK, &set_, nullptr) != 0) {
+ PLOG(FATAL) << "pthread_sigmask failed";
}
}