< prev index next >

src/java.base/share/classes/jdk/internal/vm/ThreadDumper.java

Print this page
@@ -176,13 +176,13 @@
          container.threads().forEach(t -> dumpThread(t, writer));
          container.children().forEach(c -> dumpThreads(c, writer));
      }
  
      private static boolean dumpThread(Thread thread, TextWriter writer) {
-         ThreadSnapshot snapshot = ThreadSnapshot.of(thread);
+         ThreadSnapshot snapshot = ThreadSnapshot.of(thread, true);
          if (snapshot == null) {
-             return false; // thread terminated
+             return false; // thread not alive
          }
          Instant now = Instant.now();
          Thread.State state = snapshot.threadState();
          writer.println("#" + thread.threadId() + " \"" + snapshot.threadName()
                  + "\" " + (thread.isVirtual() ? "virtual " : "") + state + " " + now);

@@ -314,13 +314,13 @@
       * @return true if the thread dump was written, false otherwise
       * @throws UncheckedIOException if an I/O error occurs
       */
      private static boolean dumpThread(Thread thread, JsonWriter jsonWriter) {
          Instant now = Instant.now();
-         ThreadSnapshot snapshot = ThreadSnapshot.of(thread);
+         ThreadSnapshot snapshot = ThreadSnapshot.of(thread, true);
          if (snapshot == null) {
-             return false; // thread terminated
+             return false; // thread not alive
          }
          Thread.State state = snapshot.threadState();
          StackTraceElement[] stackTrace = snapshot.stackTrace();
  
          jsonWriter.startObject();
< prev index next >