diff options
author | 2017-11-21 00:00:19 +0000 | |
---|---|---|
committer | 2017-11-21 00:00:19 +0000 | |
commit | e6779fde5a3c0a8bb484a61398da439a37d25b92 (patch) | |
tree | 67f5a5f0370177e62d8b8cd9bde9b0cbfa20e530 /openjdkjvmti/ti_phase.cc | |
parent | 4e0ccc92ec837bae28137c680aadb13488983173 (diff) | |
parent | af9341087aab0146b8323ece156bde8130948465 (diff) |
Merge "Revert "Make JVMTI DisposeEnvironment and GetEnv thread safe.""
Diffstat (limited to 'openjdkjvmti/ti_phase.cc')
-rw-r--r-- | openjdkjvmti/ti_phase.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/openjdkjvmti/ti_phase.cc b/openjdkjvmti/ti_phase.cc index 7157974c13..23df27fbda 100644 --- a/openjdkjvmti/ti_phase.cc +++ b/openjdkjvmti/ti_phase.cc @@ -57,7 +57,6 @@ struct PhaseUtil::PhaseCallback : public art::RuntimePhaseCallback { } void NextRuntimePhase(RuntimePhase phase) REQUIRES_SHARED(art::Locks::mutator_lock_) OVERRIDE { - art::Thread* self = art::Thread::Current(); switch (phase) { case RuntimePhase::kInitialAgents: PhaseUtil::current_phase_ = JVMTI_PHASE_PRIMORDIAL; @@ -65,7 +64,8 @@ struct PhaseUtil::PhaseCallback : public art::RuntimePhaseCallback { case RuntimePhase::kStart: { PhaseUtil::current_phase_ = JVMTI_PHASE_START; - event_handler->DispatchEvent<ArtJvmtiEvent::kVmStart>(self, GetJniEnv()); + art::ScopedThreadSuspension sts(art::Thread::Current(), art::ThreadState::kNative); + event_handler->DispatchEvent<ArtJvmtiEvent::kVmStart>(nullptr, GetJniEnv()); } break; case RuntimePhase::kInit: @@ -74,7 +74,9 @@ struct PhaseUtil::PhaseCallback : public art::RuntimePhaseCallback { PhaseUtil::current_phase_ = JVMTI_PHASE_LIVE; { ScopedLocalRef<jthread> thread(GetJniEnv(), GetCurrentJThread()); - event_handler->DispatchEvent<ArtJvmtiEvent::kVmInit>(self, GetJniEnv(), thread.get()); + art::ScopedThreadSuspension sts(art::Thread::Current(), art::ThreadState::kNative); + event_handler->DispatchEvent<ArtJvmtiEvent::kVmInit>( + nullptr, GetJniEnv(), thread.get()); } // We need to have these events be ordered to match behavior expected by some real-world // agents. The spec does not really require this but compatibility is a useful property to @@ -84,7 +86,8 @@ struct PhaseUtil::PhaseCallback : public art::RuntimePhaseCallback { break; case RuntimePhase::kDeath: { - event_handler->DispatchEvent<ArtJvmtiEvent::kVmDeath>(self, GetJniEnv()); + art::ScopedThreadSuspension sts(art::Thread::Current(), art::ThreadState::kNative); + event_handler->DispatchEvent<ArtJvmtiEvent::kVmDeath>(nullptr, GetJniEnv()); PhaseUtil::current_phase_ = JVMTI_PHASE_DEAD; } // TODO: Block events now. |