diff options
author | 2017-04-17 21:40:28 -0700 | |
---|---|---|
committer | 2017-04-17 21:40:28 -0700 | |
commit | d1fbcfffdf1e2143acf8084b99f647481e7b0290 (patch) | |
tree | e66ea4e451815ab705f5d070f16089ced6f2cecd /runtime/base/mutex-inl.h | |
parent | 36831abc29f76baee9a7673a2c18465f33df3f05 (diff) |
ART: Make less lock-level noise on abort
The lock-level violations with the abort lock aren't really all
that interesting.
Test: m test-art-host
Change-Id: I8a5fc687009db914ec8f60d86068d87e71f8a894
Diffstat (limited to 'runtime/base/mutex-inl.h')
-rw-r--r-- | runtime/base/mutex-inl.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h index 44a84c834f..08b370ec4e 100644 --- a/runtime/base/mutex-inl.h +++ b/runtime/base/mutex-inl.h @@ -89,13 +89,14 @@ inline void BaseMutex::RegisterAsLocked(Thread* self) { // Check if a bad Mutex of this level or lower is held. bool bad_mutexes_held = false; for (int i = level_; i >= 0; --i) { - BaseMutex* held_mutex = self->GetHeldMutex(static_cast<LockLevel>(i)); - if (UNLIKELY(held_mutex != nullptr)) { + LockLevel lock_level_i = static_cast<LockLevel>(i); + BaseMutex* held_mutex = self->GetHeldMutex(lock_level_i); + if (UNLIKELY(held_mutex != nullptr) && lock_level_i != kAbortLock) { LOG(ERROR) << "Lock level violation: holding \"" << held_mutex->name_ << "\" " - << "(level " << LockLevel(i) << " - " << i + << "(level " << lock_level_i << " - " << i << ") while locking \"" << name_ << "\" " << "(level " << level_ << " - " << static_cast<int>(level_) << ")"; - if (i > kAbortLock) { + if (lock_level_i > kAbortLock) { // Only abort in the check below if this is more than abort level lock. bad_mutexes_held = true; } |