summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2014-11-22 06:58:49 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-11-22 06:58:49 +0000
commitcd00b57f40da1a821c5dd3cb7000aa597dab61fc (patch)
treef31c8aff7e4c0b0d8be3e20623005f723145fdfb
parenta79da1b478e2be0d988aa021d5d4e6973c24b4a0 (diff)
parente8b547d9b4785f4804f83c07c49d3f87530747c5 (diff)
Merge "Avoid some recursive aborting."
-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);