hotspot/src/share/vm/prims/jvmtiEventController.cpp
changeset 2135 f82c3012ec86
parent 1 489c9b5090e2
child 4761 bdb7375a1fee
--- a/hotspot/src/share/vm/prims/jvmtiEventController.cpp	Mon Mar 02 13:57:17 2009 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiEventController.cpp	Mon Mar 02 14:00:23 2009 -0700
@@ -478,6 +478,11 @@
 // set external state accordingly.  Only thread-filtered events are included.
 jlong
 JvmtiEventControllerPrivate::recompute_thread_enabled(JvmtiThreadState *state) {
+  if (state == NULL) {
+    // associated JavaThread is exiting
+    return (jlong)0;
+  }
+
   jlong was_any_env_enabled = state->thread_event_enable()->_event_enabled.get_bits();
   jlong any_env_enabled = 0;
 
@@ -553,6 +558,7 @@
     {
       MutexLocker mu(Threads_lock);   //hold the Threads_lock for the iteration
       for (JavaThread *tp = Threads::first(); tp != NULL; tp = tp->next()) {
+        // state_for_while_locked() makes tp->is_exiting() check
         JvmtiThreadState::state_for_while_locked(tp);  // create the thread state if missing
       }
     }// release Threads_lock