summaryrefslogtreecommitdiff
path: root/runtime/openjdkjvmti/OpenjdkJvmTi.cc
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2017-07-12 08:46:44 -0700
committer Alex Light <allight@google.com> 2017-07-14 14:52:23 -0700
commit092a4046ff7bd3d7e24bc77cecf3d1bb0aa52107 (patch)
tree966086d6f9b69f1a677110f2d3cd3b9f0491bc3d /runtime/openjdkjvmti/OpenjdkJvmTi.cc
parent5e7eb2faccf8f4a28e9fcda26053a5b388f2190a (diff)
Ensure jvmti agents don't share ThreadLocalStorage
Bug: 63665647 Test: ./test.py --host -j40 Change-Id: Iea33cca5b708f60390b8c79462ca991363ad33a2
Diffstat (limited to 'runtime/openjdkjvmti/OpenjdkJvmTi.cc')
-rw-r--r--runtime/openjdkjvmti/OpenjdkJvmTi.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/openjdkjvmti/OpenjdkJvmTi.cc b/runtime/openjdkjvmti/OpenjdkJvmTi.cc
index 63892dd087..3c1311b18a 100644
--- a/runtime/openjdkjvmti/OpenjdkJvmTi.cc
+++ b/runtime/openjdkjvmti/OpenjdkJvmTi.cc
@@ -1498,10 +1498,11 @@ class JvmtiFunctions {
static jvmtiError DisposeEnvironment(jvmtiEnv* env) {
ENSURE_VALID_ENV(env);
- gEventHandler.RemoveArtJvmTiEnv(ArtJvmTiEnv::AsArtJvmTiEnv(env));
- art::Runtime::Current()->RemoveSystemWeakHolder(
- ArtJvmTiEnv::AsArtJvmTiEnv(env)->object_tag_table.get());
- delete env;
+ ArtJvmTiEnv* tienv = ArtJvmTiEnv::AsArtJvmTiEnv(env);
+ gEventHandler.RemoveArtJvmTiEnv(tienv);
+ art::Runtime::Current()->RemoveSystemWeakHolder(tienv->object_tag_table.get());
+ ThreadUtil::RemoveEnvironment(tienv);
+ delete tienv;
return OK;
}
@@ -1671,6 +1672,7 @@ static bool IsJvmtiVersion(jint version) {
}
extern const jvmtiInterface_1 gJvmtiInterface;
+
ArtJvmTiEnv::ArtJvmTiEnv(art::JavaVMExt* runtime, EventHandler* event_handler)
: art_vm(runtime),
local_data(nullptr),