< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java

Print this page
rev 54717 : imported patch 8223306

@@ -90,23 +90,21 @@
 
     // Get a hold of the object heap
     heap = vm.getObjectHeap();
 
     // Do each thread's roots
-    for (JavaThread thread = VM.getVM().getThreads().first();
-         thread != null;
-         thread = thread.next()) {
+    VM.getVM().getThreads().doJavaThreads((thread) -> {
       ByteArrayOutputStream bos = new ByteArrayOutputStream();
       thread.printThreadIDOn(new PrintStream(bos));
       String threadDesc =
         " in thread \"" + thread.getThreadName() +
         "\" (id " + bos.toString() + ")";
       doStack(thread,
               new RootVisitor("Stack root" + threadDesc));
       doJNIHandleBlock(thread.activeHandles(),
                        new RootVisitor("JNI handle root" + threadDesc));
-    }
+    });
 
     // Do global JNI handles
     JNIHandles handles = VM.getVM().getJNIHandles();
     doOopStorage(handles.globalHandles(),
                  new RootVisitor("Global JNI handle root"));
< prev index next >