summaryrefslogtreecommitdiffstats
path: root/runtime/base/mutex.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-12-15 17:23:45 -0800
committerMathieu Chartier <mathieuc@google.com>2014-12-15 17:31:17 -0800
commiteb0a179508f3c0533dd7db86ec7ab9dfa3773256 (patch)
tree51f4f2a694627cace4b65c7018a47c994db44bfd /runtime/base/mutex.cc
parent5b6912e455da798a79a4bb3235e276351b38ab58 (diff)
downloadart-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.cc12
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_--;