From e8b547d9b4785f4804f83c07c49d3f87530747c5 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 21 Nov 2014 22:52:16 -0800 Subject: [PATCH] Avoid some recursive aborting. Bug: 18469797 Change-Id: Ic1889a605a041bdec679ff54f8dce3842d85f2e1 --- runtime/base/mutex-inl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h index c31019116..cb698175d 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); -- 2.11.0