Should help us see if thread suspend timeouts are due to someone
holding on the mutator lock for too long or if it is a missed
futex wake.
(cherry picked from commit
f924d2381a5ea53967ba1e279766d601b9be05ea)
Bug:
17837911
Change-Id: I3417156a78f574076d5da17c86836c5a7c76084a
void ReaderWriterMutex::Dump(std::ostream& os) const {
os << name_
<< " level=" << static_cast<int>(level_)
- << " owner=" << GetExclusiveOwnerTid() << " ";
+ << " owner=" << GetExclusiveOwnerTid()
+#if ART_USE_FUTEXES
+ << " state=" << state_.LoadSequentiallyConsistent()
+ << " num_pending_writers=" << num_pending_writers_.LoadSequentiallyConsistent()
+ << " num_pending_readers=" << num_pending_readers_.LoadSequentiallyConsistent()
+#endif
+ << " ";
DumpContention(os);
}
Runtime* runtime = Runtime::Current();
std::ostringstream ss;
ss << "Thread suspend timeout\n";
+ Locks::mutator_lock_->Dump(ss);
+ ss << "\n";
runtime->GetThreadList()->Dump(ss);
LOG(FATAL) << ss.str();
exit(0);