1.1 --- a/src/share/vm/prims/jvmtiEventController.cpp Mon Mar 02 13:57:17 2009 -0700 1.2 +++ b/src/share/vm/prims/jvmtiEventController.cpp Mon Mar 02 14:00:23 2009 -0700 1.3 @@ -478,6 +478,11 @@ 1.4 // set external state accordingly. Only thread-filtered events are included. 1.5 jlong 1.6 JvmtiEventControllerPrivate::recompute_thread_enabled(JvmtiThreadState *state) { 1.7 + if (state == NULL) { 1.8 + // associated JavaThread is exiting 1.9 + return (jlong)0; 1.10 + } 1.11 + 1.12 jlong was_any_env_enabled = state->thread_event_enable()->_event_enabled.get_bits(); 1.13 jlong any_env_enabled = 0; 1.14 1.15 @@ -553,6 +558,7 @@ 1.16 { 1.17 MutexLocker mu(Threads_lock); //hold the Threads_lock for the iteration 1.18 for (JavaThread *tp = Threads::first(); tp != NULL; tp = tp->next()) { 1.19 + // state_for_while_locked() makes tp->is_exiting() check 1.20 JvmtiThreadState::state_for_while_locked(tp); // create the thread state if missing 1.21 } 1.22 }// release Threads_lock