diff --git a/src/share/vm/prims/jvmtiThreadState.hpp b/src/share/vm/prims/jvmtiThreadState.hpp index 703d873397f50b67d3cb46dbae63409a797a2b4b..5472a620bce8831582dbae89fd6dabc23f48bf03 100644 --- a/src/share/vm/prims/jvmtiThreadState.hpp +++ b/src/share/vm/prims/jvmtiThreadState.hpp @@ -319,6 +319,11 @@ class JvmtiThreadState : public CHeapObj { JvmtiThreadState *state = thread->jvmti_thread_state(); if (state == NULL) { + if (thread->is_exiting()) { + // don't add a JvmtiThreadState to a thread that is exiting + return NULL; + } + state = new JvmtiThreadState(thread); } return state;