summaryrefslogtreecommitdiffstats
path: root/runtime/thread-inl.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-11-25 22:12:27 -0800
committerAndreas Gampe <agampe@google.com>2014-11-26 01:46:03 -0800
commitef048f6f968abd59fa7fa89413a6eb85c959beaf (patch)
tree7b0afcbe5659db3ad72a60974a05ceb65672334a /runtime/thread-inl.h
parent220526b05d4365a1820a694c98527eda2d3dc980 (diff)
downloadart-ef048f6f968abd59fa7fa89413a6eb85c959beaf.tar.gz
art-ef048f6f968abd59fa7fa89413a6eb85c959beaf.tar.bz2
art-ef048f6f968abd59fa7fa89413a6eb85c959beaf.zip
ART: Add some thread abort logging
This hits intermittently on tests. Print out the thread name and the state it wants to go to. Change-Id: I86c8f0d61e23cbe4d46175a5eefaef03c23a2a81
Diffstat (limited to 'runtime/thread-inl.h')
-rw-r--r--runtime/thread-inl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h
index e30e745154..7aed8b033c 100644
--- a/runtime/thread-inl.h
+++ b/runtime/thread-inl.h
@@ -69,7 +69,12 @@ inline ThreadState Thread::SetState(ThreadState new_state) {
// Cannot use this code to change into Runnable as changing to Runnable should fail if
// old_state_and_flags.suspend_request is true.
DCHECK_NE(new_state, kRunnable);
- DCHECK_EQ(this, Thread::Current());
+ if (kIsDebugBuild && this != Thread::Current()) {
+ std::string name;
+ GetThreadName(name);
+ LOG(FATAL) << "Thread \"" << name << "\"(" << this << " != Thread::Current()="
+ << Thread::Current() << ") changing state to " << new_state;
+ }
union StateAndFlags old_state_and_flags;
old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
tls32_.state_and_flags.as_struct.state = new_state;