Class WithThreadName
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.support.concurrent.WithThreadName
-
- All Implemented Interfaces:
AutoCloseable
public final class WithThreadName extends Object implements AutoCloseable
Utility to temporarily append some information to the name of the current thread. This is helpful for making thread dumps more readable and informative: stack trace elements do not contain any information about object identity.
-
-
Constructor Summary
Constructors Constructor Description WithThreadName(String suffix)
Sets the current thread’s name.
-
-
-
Constructor Detail
-
WithThreadName
public WithThreadName(String suffix)
Sets the current thread’s name.- Parameters:
suffix
- text to append to the original name
-
-
Method Detail
-
close
public void close()
Restores the original name.- Specified by:
close
in interfaceAutoCloseable
-
-