Package org.zkoss.lang
Class Threads
java.lang.Object
org.zkoss.lang.Threads
Thread relevant utilities.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidA dummy function that is used to avoid compiler from optimizing statements around it.static final voidjoinAndInterrupt(Thread thd, int timeout) Waits a thread to die (and interrupt once a while)static final voidSets the priority without throwing any exception but log warning.static final voidsetPriority(Thread thd, int priority) Sets the priority without throwing any exception but log warning.static final voidsleep(int millisecs) Put the current thread to sleep for a while.
-
Constructor Details
-
Threads
public Threads()
-
-
Method Details
-
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
Sets the priority without throwing any exception but log warning. -
setDaemon
Sets the priority without throwing any exception but log warning. -
joinAndInterrupt
Waits a thread to die (and interrupt once a while)- Parameters:
timeout- how long to wait (0 means forever)- Throws:
InterruptedException
-
dummy
A dummy function that is used to avoid compiler from optimizing statements around it.
-