diff options
-rw-r--r-- | runtime/thread-inl.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h index e30e745..7aed8b0 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; |