< prev index next >

src/hotspot/share/prims/jvmtiEventController.cpp

Print this page
rev 47674 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47676 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47677 : eosterlund CR - need more inline fixes.
rev 47678 : eosterlund, stefank CR - more inline and style cleanups
rev 47679 : stefank, coleenp CR - refactor most JavaThreadIterator usage to use JavaThreadIteratorWithHandle.

@@ -31,11 +31,12 @@
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "prims/jvmtiThreadState.inline.hpp"
 #include "runtime/frame.hpp"
-#include "runtime/thread.hpp"
+#include "runtime/thread.inline.hpp"
+#include "runtime/threadSMR.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vframe_hp.hpp"
 #include "runtime/vmThread.hpp"
 #include "runtime/vm_operations.hpp"
 

@@ -578,17 +579,14 @@
 
   // We need to create any missing jvmti_thread_state if there are globally set thread
   // filtered events and there weren't last time
   if (    (any_env_thread_enabled & THREAD_FILTERED_EVENT_BITS) != 0 &&
       (was_any_env_thread_enabled & THREAD_FILTERED_EVENT_BITS) == 0) {
-    {
-      MutexLocker mu(Threads_lock);   //hold the Threads_lock for the iteration
-      for (JavaThread *tp = Threads::first(); tp != NULL; tp = tp->next()) {
+    for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.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
   }
 
   // compute and set thread-filtered events
   for (JvmtiThreadState *state = JvmtiThreadState::first(); state != NULL; state = state->next()) {
     any_env_thread_enabled |= recompute_thread_enabled(state);
< prev index next >