Address comments for aog/934603
Test: TH
Change-Id: I6b54cfbaa49d320c3c9e97ebaeeb97e285f9bf43
diff --git a/runtime/barrier.cc b/runtime/barrier.cc
index f0fa66a..d144591 100644
--- a/runtime/barrier.cc
+++ b/runtime/barrier.cc
@@ -107,7 +107,7 @@
if (count_ != 0) {
// Only check when not aborting and if we verify the count on shutdown.
LOG((gAborting == 0 && verify_count_on_shutdown_) ? FATAL : WARNING)
- << "Attempted to destroy barrier with non zero count" << count_;
+ << "Attempted to destroy barrier with non zero count " << count_;
}
}
diff --git a/runtime/barrier.h b/runtime/barrier.h
index 704ecb0..ad8f66f 100644
--- a/runtime/barrier.h
+++ b/runtime/barrier.h
@@ -45,7 +45,7 @@
};
// If verify_count_on_shutdown is true, the destructor verifies that the count is zero in the
- // destructor. This means that all expected threads have went through the barrier.
+ // destructor. This means that all expected threads went through the barrier.
explicit Barrier(int count, bool verify_count_on_shutdown = true);
virtual ~Barrier();
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index f07dca1..ed6b2c9 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -203,6 +203,8 @@
public:
DumpCheckpoint(std::ostream* os, bool dump_native_stack)
: os_(os),
+ // Avoid verifying count in case a thread doesn't end up passing through the barrier.
+ // This avoids a SIGABRT that would otherwise happen in the destructor.
barrier_(0, /*verify_count_on_shutdown=*/false),
backtrace_map_(dump_native_stack ? BacktraceMap::Create(getpid()) : nullptr),
dump_native_stack_(dump_native_stack) {