Package overit.geocall.util
Class ThreadUtils
java.lang.Object
overit.geocall.util.ThreadUtils
Collection of static utilities for managing threads.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown if a request of interruption is sended to a Thread that has calledfairSleep(long) -
Method Summary
-
Method Details
-
sleep
public static void sleep(long millis) Causes the currently executing thread to sleep for the specified number of milliseconds. The thread does not lose ownership of any monitors. In the case that an interruption is asked to the current thread, it exits immediatly leaving the interrupted flag to true.- Parameters:
millis- The length of time to sleep in milliseconds
-
fairSleep
public static void fairSleep(long millis) Causes the currently executing thread to sleep for the specified number of milliseconds. The thread does not lose ownership of any monitors. In the case that an interruption is asked to the current thread, it immediatly throws a runtimeThreadUtils.BreakExceptionleaving the interrupted flag to true.- Parameters:
millis- The length of time to sleep in milliseconds
-