Package org.zkoss.lang
Class Threads
- java.lang.Object
-
- org.zkoss.lang.Threads
-
public class Threads extends java.lang.ObjectThread relevant utilities.- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description Threads()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddummy(java.lang.Object o)A dummy function that is used to avoid compiler from optimizing statements around it.static voidjoinAndInterrupt(java.lang.Thread thd, int timeout)Waits a thread to die (and interrupt once a while)static voidsetDaemon(java.lang.Thread thd, boolean daemon)Sets the priority without throwing any exception but log warning.static voidsetPriority(java.lang.Thread thd, int priority)Sets the priority without throwing any exception but log warning.static voidsleep(int millisecs)Put the current thread to sleep for a while.
-
-
-
Method Detail
-
sleep
public static final void sleep(int millisecs)
Put the current thread to sleep for a while.- Throws:
SystemException- if it is interrupted.- Since:
- 3.0.0
-
setPriority
public static final void setPriority(java.lang.Thread thd, int priority)Sets the priority without throwing any exception but log warning.
-
setDaemon
public static final void setDaemon(java.lang.Thread thd, boolean daemon)Sets the priority without throwing any exception but log warning.
-
joinAndInterrupt
public static final void joinAndInterrupt(java.lang.Thread thd, int timeout) throws java.lang.InterruptedExceptionWaits a thread to die (and interrupt once a while)- Parameters:
timeout- how long to wait (0 means forever)- Throws:
java.lang.InterruptedException
-
dummy
public static final void dummy(java.lang.Object o)
A dummy function that is used to avoid compiler from optimizing statements around it.
-
-