summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2017-01-13 10:46:01 -0800
committer Andreas Gampe <agampe@google.com> 2017-01-13 10:50:55 -0800
commit1f64859d59dc5da93913a1230cbb4e66d6e524c0 (patch)
treeb099e7c09eaa4f58dcbfa90514f8416ba6721483
parentc00735af8acafb0920f84f663c88df4a59894241 (diff)
ART: Remove suspension from AttachAgent
It conflicts with calls later. Every plugin needs to do local protections for itself. Follow-up to commit ad2dc875ce29c3fafc1129a2a25184df28b66a10. Bug: 31682382 Bug: 34275017 Test: m test-art-host-run-test-909-attach-agent Change-Id: Ib698d880feb774a00c819ef14c27a48501ca1f13
-rw-r--r--runtime/runtime.cc7
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);
}