diff options
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/logging.cc | 2 | ||||
-rw-r--r-- | runtime/base/logging.h | 5 | ||||
-rw-r--r-- | runtime/base/mutex-inl.h | 8 | ||||
-rw-r--r-- | runtime/base/mutex.cc | 4 | ||||
-rw-r--r-- | runtime/base/mutex.h | 12 |
5 files changed, 10 insertions, 21 deletions
diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc index b781d6008..bdc4cf639 100644 --- a/runtime/base/logging.cc +++ b/runtime/base/logging.cc @@ -35,8 +35,6 @@ namespace art { LogVerbosity gLogVerbosity; -unsigned int gAborting = 0; - static LogSeverity gMinimumLogSeverity = INFO; static std::unique_ptr<std::string> gCmdLine; static std::unique_ptr<std::string> gProgramInvocationName; diff --git a/runtime/base/logging.h b/runtime/base/logging.h index ae83e331f..a9cc99b08 100644 --- a/runtime/base/logging.h +++ b/runtime/base/logging.h @@ -55,11 +55,6 @@ struct LogVerbosity { // Global log verbosity setting, initialized by InitLogging. extern LogVerbosity gLogVerbosity; -// 0 if not abort, non-zero if an abort is in progress. Used on fatal exit to prevents recursive -// aborts. Global declaration allows us to disable some error checking to ensure fatal shutdown -// makes forward progress. -extern unsigned int gAborting; - // Configure logging based on ANDROID_LOG_TAGS environment variable. // We need to parse a string that looks like // diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h index cb698175d..020634122 100644 --- a/runtime/base/mutex-inl.h +++ b/runtime/base/mutex-inl.h @@ -97,9 +97,7 @@ inline void BaseMutex::RegisterAsLocked(Thread* self) { } } } - if (gAborting == 0) { // Avoid recursive aborts. - CHECK(!bad_mutexes_held); - } + 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. @@ -114,7 +112,7 @@ inline void BaseMutex::RegisterAsUnlocked(Thread* self) { return; } if (level_ != kMonitorLock) { - if (kDebugLocking && gAborting == 0) { // Avoid recursive aborts. + if (kDebugLocking) { CHECK(self->GetHeldMutex(level_) == this) << "Unlocking on unacquired mutex: " << name_; } self->SetHeldMutex(level_, NULL); @@ -178,7 +176,7 @@ inline bool Mutex::IsExclusiveHeld(const Thread* self) const { bool result = (GetExclusiveOwnerTid() == SafeGetTid(self)); if (kDebugLocking) { // Sanity debug check that if we think it is locked we have it in our held mutexes. - if (result && self != NULL && level_ != kMonitorLock && !gAborting) { + if (result && self != NULL && level_ != kMonitorLock) { CHECK_EQ(self->GetHeldMutex(level_), this); } } diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index aa2aefc31..49579886f 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -209,9 +209,7 @@ void BaseMutex::CheckSafeToWait(Thread* self) { } } } - if (gAborting == 0) { // Avoid recursive aborts. - CHECK(!bad_mutexes_held); - } + CHECK(!bad_mutexes_held); } } diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h index 9c93cc624..41b5f12fd 100644 --- a/runtime/base/mutex.h +++ b/runtime/base/mutex.h @@ -220,7 +220,7 @@ class LOCKABLE Mutex : public BaseMutex { // Assert that the Mutex is exclusively held by the current thread. void AssertExclusiveHeld(const Thread* self) { - if (kDebugLocking && (gAborting == 0)) { + if (kDebugLocking) { CHECK(IsExclusiveHeld(self)) << *this; } } @@ -228,7 +228,7 @@ class LOCKABLE Mutex : public BaseMutex { // Assert that the Mutex is not held by the current thread. void AssertNotHeldExclusive(const Thread* self) { - if (kDebugLocking && (gAborting == 0)) { + if (kDebugLocking) { CHECK(!IsExclusiveHeld(self)) << *this; } } @@ -318,7 +318,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread has exclusive access to the ReaderWriterMutex. void AssertExclusiveHeld(const Thread* self) { - if (kDebugLocking && (gAborting == 0)) { + if (kDebugLocking) { CHECK(IsExclusiveHeld(self)) << *this; } } @@ -326,7 +326,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread doesn't have exclusive access to the ReaderWriterMutex. void AssertNotExclusiveHeld(const Thread* self) { - if (kDebugLocking && (gAborting == 0)) { + if (kDebugLocking) { CHECK(!IsExclusiveHeld(self)) << *this; } } @@ -337,7 +337,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread has shared access to the ReaderWriterMutex. void AssertSharedHeld(const Thread* self) { - if (kDebugLocking && (gAborting == 0)) { + if (kDebugLocking) { // TODO: we can only assert this well when self != NULL. CHECK(IsSharedHeld(self) || self == NULL) << *this; } @@ -347,7 +347,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread doesn't hold this ReaderWriterMutex either in shared or exclusive // mode. void AssertNotHeld(const Thread* self) { - if (kDebugLocking && (gAborting == 0)) { + if (kDebugLocking) { CHECK(!IsSharedHeld(self)) << *this; } } |