diff options
author | Haamed Gheibi <haamed@google.com> | 2021-10-05 02:43:53 +0000 |
---|---|---|
committer | Haamed Gheibi <haamed@google.com> | 2021-10-05 02:43:53 +0000 |
commit | 28ae49ccaff18c2da1e2d3c9597707a19b54bf08 (patch) | |
tree | 212c3caf452127b233eab3e03e9b8218bb348e05 | |
parent | 693713c9cad26e713478294ecb1377ba3a0e51f3 (diff) | |
parent | 8d44c3d61d4bde412f06190cd4acc4afc2ea469c (diff) |
Merge SP1A.210812.016
Change-Id: Iaf4bb73cf665ece167027bf375605ea70dd16975
-rw-r--r-- | runtime/class_linker.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index b9751ab965..8b9e42a572 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -9814,22 +9814,16 @@ void ClassLinker::SetEntryPointsForObsoleteMethod(ArtMethod* method) const { } void ClassLinker::DumpForSigQuit(std::ostream& os) { - // Avoid a deadlock between a garbage collecting thread running a checkpoint, - // a thread holding the dex or classlinker lock and blocking on a condition variable for - // weak references access, and a thread blocking on the dex or classlinker lock and thus - // unable to run the checkpoint. - Thread* self = Thread::Current(); - ScopedObjectAccess soa(self); - gc::ScopedGCCriticalSection gcs(self, gc::kGcCauseClassLinker, gc::kCollectorTypeClassLinker); - ReaderMutexLock mu(self, *Locks::classlinker_classes_lock_); + ScopedObjectAccess soa(Thread::Current()); + ReaderMutexLock mu(soa.Self(), *Locks::classlinker_classes_lock_); os << "Zygote loaded classes=" << NumZygoteClasses() << " post zygote classes=" << NumNonZygoteClasses() << "\n"; - ReaderMutexLock mu2(self, *Locks::dex_lock_); + ReaderMutexLock mu2(soa.Self(), *Locks::dex_lock_); os << "Dumping registered class loaders\n"; size_t class_loader_index = 0; for (const ClassLoaderData& class_loader : class_loaders_) { ObjPtr<mirror::ClassLoader> loader = - ObjPtr<mirror::ClassLoader>::DownCast(self->DecodeJObject(class_loader.weak_root)); + ObjPtr<mirror::ClassLoader>::DownCast(soa.Self()->DecodeJObject(class_loader.weak_root)); if (loader != nullptr) { os << "#" << class_loader_index++ << " " << loader->GetClass()->PrettyDescriptor() << ": ["; bool saw_one_dex_file = false; @@ -9848,7 +9842,7 @@ void ClassLinker::DumpForSigQuit(std::ostream& os) { size_t parent_index = 0; for (const ClassLoaderData& class_loader2 : class_loaders_) { ObjPtr<mirror::ClassLoader> loader2 = ObjPtr<mirror::ClassLoader>::DownCast( - self->DecodeJObject(class_loader2.weak_root)); + soa.Self()->DecodeJObject(class_loader2.weak_root)); if (loader2 == loader->GetParent()) { os << ", parent #" << parent_index; found_parent = true; |