hotspot/src/share/vm/prims/jvmtiThreadState.cpp
void JvmtiThreadState::add_env(JvmtiEnvBase *env) {
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
assert(JvmtiThreadState_lock->is_locked(), "sanity check");
{- -------------------------------------------
(1) env 引数の JvmtiEnvBase オブジェクトに対応する
新しい JvmtiEnvThreadState オブジェクトを生成する.
---------------------------------------- -}
JvmtiEnvThreadState *new_ets = new JvmtiEnvThreadState(_thread, env);
{- -------------------------------------------
(1) 生成した JvmtiEnvThreadState オブジェクトを
この JvmtiThreadState オブジェクト内に登録する.
---------------------------------------- -}
// add this environment thread state to the end of the list (order is important)
{
// list deallocation (which occurs at a safepoint) cannot occur simultaneously
debug_only(No_Safepoint_Verifier nosafepoint;)
JvmtiEnvThreadStateIterator it(this);
JvmtiEnvThreadState* previous_ets = NULL;
for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
previous_ets = ets;
}
if (previous_ets == NULL) {
set_head_env_thread_state(new_ets);
} else {
previous_ets->set_next(new_ets);
}
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.