Class ThreadUtils
- java.lang.Object
-
- com.igormaznitsa.meta.common.utils.ThreadUtils
-
public final class ThreadUtils extends java.lang.ObjectAuxiliary methods for thread processing.- Since:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description privateThreadUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleansilentSleep(long milliseconds)Just suspend the current thread for defined interval in milliseconds.static intstackDepth()Get the stack call depth for the caller.static java.lang.StackTraceElementstackElement()Get the stack element of the method caller.
-
-
-
Method Detail
-
silentSleep
@Weight(VARIABLE) public static boolean silentSleep(long milliseconds)
Just suspend the current thread for defined interval in milliseconds.- Parameters:
milliseconds- milliseconds to sleep- Returns:
- false if the sleep has been interrupted by InterruptedException, true otherwise.
- Since:
- 1.0
- See Also:
Thread.sleep(long)
-
stackElement
@Weight(VARIABLE) public static java.lang.StackTraceElement stackElement()
Get the stack element of the method caller.- Returns:
- the stack trace element for the calling method.
- Since:
- 1.0
-
-