src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java
changeset 54955 46409371a691
parent 47216 71c04702a3d5
child 58743 083bbca50d2d
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java	Tue May 21 00:52:04 2019 -0700
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java	Tue May 21 10:34:57 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -201,7 +201,8 @@
       jframeCache = new HashMap();
       proxyToThread = new HashMap();
       Threads threads = VM.getVM().getThreads();
-      for (JavaThread cur = threads.first(); cur != null; cur = cur.next()) {
+      for (int i = 0; i < threads.getNumberOfThreads(); i++) {
+         JavaThread cur = threads.getJavaThreadAt(i);
          List tmp = new ArrayList(10);
          try {
             for (JavaVFrame vf = cur.getLastJavaVFrameDbg(); vf != null; vf = vf.javaSender()) {