Class NamedThreadUtil


  • public class NamedThreadUtil
    extends Object
    Created 19.11.12 17:35
    Since:
    TC 8.0
    Author:
    Eugene Petrenko (eugene.petrenko@jetbrains.com)
    • Constructor Detail

      • NamedThreadUtil

        public NamedThreadUtil()
    • Method Detail

      • updateThreadName

        @NotNull
        public static NamedThreadUtil.ThreadNameCookie updateThreadName​(@NotNull
                                                                        String newDetails)
        Updates current thread name to include new details
        Parameters:
        newDetails - new thread name
        Returns:
        cookie to revert thread name change
        Since:
        TC 8.0
      • updateThreadName

        @NotNull
        public static Disposable updateThreadName​(@NotNull
                                                  String newDetails,
                                                  boolean rememberThreadStatistics)
        Deprecated.
        rememberThreadStatistics is no longer used here
        Updates current thread name to include new details, also remembers additional thread related statistics if possible (allocated memory on the moment of method call).
        Parameters:
        newDetails - new thread name
        Returns:
        disposable object to revert thread name change
        Since:
        TC 8.1
      • getTcThreadPrefix

        public static String getTcThreadPrefix()
        Returns:
        Thread name debug prefix with timestamp
        Since:
        8.0.5
      • getThreadStatistics

        @Nullable
        public static long[] getThreadStatistics​(@NotNull
                                                 Thread thread)
      • updateThreadStatistics

        public static void updateThreadStatistics()