summaryrefslogtreecommitdiffstats
path: root/runtime/runtime_linux.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-01-14 18:35:01 -0800
committerAndreas Gampe <agampe@google.com>2015-01-14 18:35:01 -0800
commitcbfded4112c554ac3f91bdbf02e6c950ba1f1a1a (patch)
treef3c8d6f29448664ca5508868c2dc9b39c02efbf2 /runtime/runtime_linux.cc
parent44c78b3f33688888078990df4fb5f14c78247a20 (diff)
downloadart-cbfded4112c554ac3f91bdbf02e6c950ba1f1a1a.tar.gz
art-cbfded4112c554ac3f91bdbf02e6c950ba1f1a1a.tar.bz2
art-cbfded4112c554ac3f91bdbf02e6c950ba1f1a1a.zip
ART: Host timeout Mac build fix.
Mac fix for unsupported SIGRTMIN introduced in commit 038bb2252ed1d7132f45006507e389b7ba1617ce. Bug: 18933933 Change-Id: I502cda51802d67f089c09240d89f71166ed56c6d
Diffstat (limited to 'runtime/runtime_linux.cc')
-rw-r--r--runtime/runtime_linux.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/runtime_linux.cc b/runtime/runtime_linux.cc
index a0adcd1082..55dfb0fc94 100644
--- a/runtime/runtime_linux.cc
+++ b/runtime/runtime_linux.cc
@@ -34,6 +34,7 @@
namespace art {
static constexpr bool kDumpHeapObjectOnSigsevg = false;
+static constexpr bool kUseSigRTTimeout = true;
struct Backtrace {
public:
@@ -284,8 +285,14 @@ struct UContext {
mcontext_t& context;
};
+// Return the signal number we recognize as timeout. -1 means not active/supported.
static int GetTimeoutSignal() {
- return SIGRTMIN + 2;
+#if defined(__APPLE__)
+ // Mac does not support realtime signals.
+ return -1;
+#else
+ return kUseSigRTTimeout ? (SIGRTMIN + 2) : -1;
+#endif
}
static bool IsTimeoutSignal(int signal_number) {
@@ -392,7 +399,9 @@ void Runtime::InitPlatformSignalHandlers() {
#endif
rc += sigaction(SIGTRAP, &action, NULL);
// Special dump-all timeout.
- rc += sigaction(GetTimeoutSignal(), &action, NULL);
+ if (GetTimeoutSignal() != -1) {
+ rc += sigaction(GetTimeoutSignal(), &action, NULL);
+ }
CHECK_EQ(rc, 0);
}