From 1e4b0ca3bde8ea792aad83aefc891628ff6ec806 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 14 Jan 2015 09:06:32 -0800 Subject: [PATCH] ART: Change ternary location for timeout Make the decision for timeout length in the constant, not at the use site. Bug: 18964791 Change-Id: I73e6ef5e1c23fd515eaa61ba68236698d3e5c81a --- runtime/thread_list.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index 364b7c226..0f6488342 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc @@ -152,8 +152,7 @@ void ThreadList::DumpUnattachedThreads(std::ostream& os) { // Dump checkpoint timeout in milliseconds. Larger amount on the host, as dumping will invoke // addr2line when available. -static constexpr uint32_t kDumpWaitTimeoutTarget = 10000; -static constexpr uint32_t kDumpWaitTimeoutHost = 20000; +static constexpr uint32_t kDumpWaitTimeout = kIsTargetBuild ? 10000 : 20000; // A closure used by Thread::Dump. class DumpCheckpoint FINAL : public Closure { @@ -181,8 +180,7 @@ class DumpCheckpoint FINAL : public Closure { void WaitForThreadsToRunThroughCheckpoint(size_t threads_running_checkpoint) { Thread* self = Thread::Current(); ScopedThreadStateChange tsc(self, kWaitingForCheckPointsToRun); - bool timed_out = barrier_.Increment(self, threads_running_checkpoint, - kIsTargetBuild ? kDumpWaitTimeoutTarget : kDumpWaitTimeoutHost); + bool timed_out = barrier_.Increment(self, threads_running_checkpoint, kDumpWaitTimeout); if (timed_out) { // Avoid a recursive abort. LOG((kIsDebugBuild && (gAborting == 0)) ? FATAL : ERROR) -- 2.11.0