Package org.kendar.sync.lib.utils
Class Sleeper
java.lang.Object
org.kendar.sync.lib.utils.Sleeper
No thread lock wait
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsleep(long timeoutMillis) Runs a synchronized-based wait mechanism instead of sleepstatic voidsleep(long timeoutMillis, BooleanSupplier booleanSupplier) static voidsleepNoException(long timeoutMillis, BooleanSupplier booleanSupplier) static voidsleepNoException(long timeoutMillis, BooleanSupplier booleanSupplier, boolean silent) static voidyield()Give control to other threads
-
Constructor Details
-
Sleeper
public Sleeper()
-
-
Method Details
-
sleep
public static void sleep(long timeoutMillis) Runs a synchronized-based wait mechanism instead of sleep- Parameters:
timeoutMillis- Timeout in ms
-
sleep
-
sleepNoException
-
sleepNoException
public static void sleepNoException(long timeoutMillis, BooleanSupplier booleanSupplier, boolean silent) -
yield
public static void yield()Give control to other threads
-