if (thread_oop == NULL) { // Then thread should not be NULL (see assert above).
thread_oop = thread->jvmti_vthread() != NULL ? thread->jvmti_vthread() : thread->threadObj();
}
// In a case of unmounted virtual thread the thread can be NULL.
JvmtiThreadState *state = thread == NULL ? NULL : thread->jvmti_thread_state();
if (state == NULL && thread != NULL && thread->is_exiting()) { // Don't add a JvmtiThreadState to a thread that is exiting. return NULL;
} if (state == NULL || state->get_thread_oop() != thread_oop) { // Check if java_lang_Thread already has a link to the JvmtiThreadState. if (thread_oop != NULL) { // thread_oop can be NULL during early VMStart.
state = java_lang_Thread::jvmti_thread_state(thread_oop);
} if (state == NULL) { // Need to create state.
state = new JvmtiThreadState(thread, thread_oop);
}
} return state;
}
inline JvmtiThreadState* JvmtiThreadState::state_for(JavaThread *thread, Handle thread_handle) { // In a case of unmounted virtual thread the thread can be NULL.
JvmtiThreadState* state = thread_handle == NULL ? thread->jvmti_thread_state() :
java_lang_Thread::jvmti_thread_state(thread_handle()); if (state == NULL) {
MutexLocker mu(JvmtiThreadState_lock); // check again with the lock held
state = state_for_while_locked(thread, thread_handle());
} else { // Check possible safepoint even if state is non-null. // (Note: the thread argument isn't the current thread)
DEBUG_ONLY(JavaThread::current()->check_possible_safepoint());
} return state;
}
inline JavaThread* JvmtiThreadState::get_thread_or_saved() { // Use _thread_saved if cthread is detached from JavaThread (_thread == NULL). return (_thread == NULL && !is_virtual()) ? _thread_saved : _thread;
}
inlinevoid JvmtiThreadState::unbind_from(JvmtiThreadState* state, JavaThread* thread) { if (state == NULL) { return;
} // Save thread's interp_only_mode.
state->_saved_interp_only_mode = thread->get_interp_only_mode();
state->set_thread(NULL); // Make sure stale _thread value is never used.
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.