Module jdk.jfr

Class RecordedThread



  • public final class RecordedThread
    extends RecordedObject
    A recorded thread.
    Since:
    9
    • Method Detail

      • getOSName

        public String getOSName​()
        Returns the thread name used by the operating system.
        Returns:
        OS thread name, or null if not available
      • getOSThreadId

        public long getOSThreadId​()
        Returns the thread id used by the operating system.
        Returns:
        Java thread id, or -1 if not available
      • getThreadGroup

        public RecordedThreadGroup getThreadGroup​()
        Returns the Java thread group, if available.
        Returns:
        thread group, or null if not available
      • getJavaName

        public String getJavaName​()
        Returns the Java thread name, or null if not available.

        Returns java.lang.Thread.getName() if the thread has a Java representation. null otherwise.

        Returns:
        Java thread name, or null if not available
      • getJavaThreadId

        public long getJavaThreadId​()
        Returns the Java thread id, or -1 not available.

        Returns java.lang.Thread.getId() if the thread is a Java thread, otherwise -1.

        Returns:
        thread id, or -1 if it's not a Java thread
      • getId

        public long getId​()
        Returns a unique id for both native threads and Java threads that can never be reused within the lifespan of the JVM.

        See getJavaThreadId() for the id return by java.lang.Thread.getId()

        Returns:
        a unique id for the thread