From ef048f6f968abd59fa7fa89413a6eb85c959beaf Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 25 Nov 2014 22:12:27 -0800 Subject: 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 --- runtime/thread-inl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime') 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; -- cgit v1.2.3-59-g8ed1b