summaryrefslogtreecommitdiff
path: root/runtime/base/mutex-inl.h
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2014-11-21 22:52:16 -0800
committer Ian Rogers <irogers@google.com> 2014-11-21 22:57:44 -0800
commite8b547d9b4785f4804f83c07c49d3f87530747c5 (patch)
treef31c8aff7e4c0b0d8be3e20623005f723145fdfb /runtime/base/mutex-inl.h
parenta79da1b478e2be0d988aa021d5d4e6973c24b4a0 (diff)
Avoid some recursive aborting.
Bug: 18469797 Change-Id: Ic1889a605a041bdec679ff54f8dce3842d85f2e1
Diffstat (limited to 'runtime/base/mutex-inl.h')
-rw-r--r--runtime/base/mutex-inl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h
index c310191166..cb698175df 100644
--- a/runtime/base/mutex-inl.h
+++ b/runtime/base/mutex-inl.h
@@ -97,7 +97,9 @@ inline void BaseMutex::RegisterAsLocked(Thread* self) {
}
}
}
- CHECK(!bad_mutexes_held);
+ if (gAborting == 0) { // Avoid recursive aborts.
+ CHECK(!bad_mutexes_held);
+ }
}
// Don't record monitors as they are outside the scope of analysis. They may be inspected off of
// the monitor list.
@@ -112,7 +114,7 @@ inline void BaseMutex::RegisterAsUnlocked(Thread* self) {
return;
}
if (level_ != kMonitorLock) {
- if (kDebugLocking && !gAborting) {
+ if (kDebugLocking && gAborting == 0) { // Avoid recursive aborts.
CHECK(self->GetHeldMutex(level_) == this) << "Unlocking on unacquired mutex: " << name_;
}
self->SetHeldMutex(level_, NULL);