diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-12-15 17:23:45 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-12-15 17:31:17 -0800 |
commit | eb0a179508f3c0533dd7db86ec7ab9dfa3773256 (patch) | |
tree | 51f4f2a694627cace4b65c7018a47c994db44bfd /runtime/base/mutex.cc | |
parent | 5b6912e455da798a79a4bb3235e276351b38ab58 (diff) | |
download | art-eb0a179508f3c0533dd7db86ec7ab9dfa3773256.zip art-eb0a179508f3c0533dd7db86ec7ab9dfa3773256.tar.gz art-eb0a179508f3c0533dd7db86ec7ab9dfa3773256.tar.bz2 |
Add more logging to Mutex::ExclusiveUnlock
Bug: 18713034
Change-Id: I9db5ca0a25592714ac9e292a2b8d46ef73779c8b
Diffstat (limited to 'runtime/base/mutex.cc')
-rw-r--r-- | runtime/base/mutex.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index da78082..a4eb318 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -434,7 +434,17 @@ bool Mutex::ExclusiveTryLock(Thread* self) { } void Mutex::ExclusiveUnlock(Thread* self) { - DCHECK(self == NULL || self == Thread::Current()); + if (kIsDebugBuild && self != nullptr && self != Thread::Current()) { + std::string name1 = "<null>"; + std::string name2 = "<null>"; + if (self != nullptr) { + self->GetThreadName(name1); + } + if (Thread::Current() != nullptr) { + Thread::Current()->GetThreadName(name2); + } + LOG(FATAL) << name1 << " " << name2; + } AssertHeld(self); DCHECK_NE(exclusive_owner_, 0U); recursion_count_--; |