diff options
| -rw-r--r-- | runtime/runtime.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index df5fc5ce8a..55e1852c0c 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1384,11 +1384,6 @@ static bool EnsureJvmtiPlugin(Runtime* runtime, Plugin new_plugin = Plugin::Create(plugin_name); - // Suspend all threads to protect ourself somewhat. - Thread* self = Thread::Current(); - ScopedObjectAccess soa(self); // Now we know we have the shared lock. - ScopedThreadSuspension sts(self, art::kWaitingForDebuggerToAttach); - ScopedSuspendAll ssa("EnsureJvmtiPlugin"); if (!new_plugin.Load(error_msg)) { return false; } @@ -2235,6 +2230,8 @@ void Runtime::AddSystemWeakHolder(gc::AbstractSystemWeakHolder* holder) { gc::ScopedGCCriticalSection gcs(Thread::Current(), gc::kGcCauseAddRemoveSystemWeakHolder, gc::kCollectorTypeAddRemoveSystemWeakHolder); + // Note: The ScopedGCCriticalSection also ensures that the rest of the function is in + // a critical section. system_weak_holders_.push_back(holder); } |