review: moved comment clarifying _thread from its init to definition

This commit is contained in:
Serguei Spitsyn 2026-02-18 11:12:02 -08:00
parent e591f869fb
commit 8d7f426173
2 changed files with 5 additions and 6 deletions

View File

@ -56,12 +56,7 @@ bool JvmtiThreadState::_seen_interp_only_mode = false;
JvmtiThreadState::JvmtiThreadState(JavaThread* thread, oop thread_oop)
: _thread_event_enable() {
assert(JvmtiThreadState_lock->is_locked(), "sanity check");
// The _thread field is a link to the JavaThread associated with JvmtiThreadState.
// A carrier thread shgould always have a stable link to its JavaThread.
// The _thread field of a virtual thread should point to the JavaThread when
// virtual thread is mounted. It should be set to null when it is unmounted.
_thread = thread;
_thread = thread;
_exception_state = ES_CLEARED;
_hide_single_stepping = false;
_pending_interp_only_mode = false;

View File

@ -123,6 +123,10 @@ class JvmtiVTSuspender : AllStatic {
class JvmtiThreadState : public CHeapObj<mtInternal> {
private:
friend class JvmtiEnv;
// The _thread field is a link to the JavaThread associated with JvmtiThreadState.
// A platform (including carrier) thread should always have a stable link to its JavaThread.
// The _thread field of a virtual thread should point to the JavaThread when
// virtual thread is mounted. It should be set to null when it is unmounted.
JavaThread *_thread;
OopHandle _thread_oop_h;
// Jvmti Events that cannot be posted in their current context.