< prev index next >

src/hotspot/share/prims/jvmtiTagMap.cpp

Print this page
rev 47287 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47289 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47290 : eosterlund CR - need more inline fixes.

@@ -43,10 +43,12 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/reflectionUtils.hpp"
+#include "runtime/thread.inline.hpp"
+#include "runtime/threadSMR.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vmThread.hpp"
 #include "runtime/vm_operations.hpp"
 #include "services/serviceUtil.hpp"
 #include "utilities/macros.hpp"

@@ -3173,11 +3175,13 @@
 // Collects the simple roots for all threads and collects all
 // stack roots - for each thread it walks the execution
 // stack to find all references and local JNI refs.
 inline bool VM_HeapWalkOperation::collect_stack_roots() {
   JNILocalRootsClosure blk;
-  for (JavaThread* thread = Threads::first(); thread != NULL ; thread = thread->next()) {
+  ThreadsListHandle tlh;
+  JavaThreadIterator jti(tlh.list());
+  for (JavaThread* thread = jti.first(); thread != NULL; thread = jti.next()) {
     oop threadObj = thread->threadObj();
     if (threadObj != NULL && !thread->is_exiting() && !thread->is_hidden_from_external_view()) {
       // Collect the simple root for this thread before we
       // collect its stack roots
       if (!CallbackInvoker::report_simple_root(JVMTI_HEAP_REFERENCE_THREAD,
< prev index next >