public class Threads extends Object
| Constructor and Description |
|---|
Threads() |
| Modifier and Type | Method and Description |
|---|---|
static void |
dummy(Object o)
A dummy function that is used to avoid compiler from optimizing
statements around it.
|
static void |
joinAndInterrupt(Thread thd,
int timeout)
Waits a thread to die (and interrupt once a while)
|
static void |
setDaemon(Thread thd,
boolean daemon)
Sets the priority without throwing any exception but log warning.
|
static void |
setPriority(Thread thd,
int priority)
Sets the priority without throwing any exception but log warning.
|
static void |
sleep(int millisecs)
Put the current thread to sleep for a while.
|
public static final void sleep(int millisecs)
SystemException - if it is interrupted.public static final void setPriority(Thread thd, int priority)
public static final void setDaemon(Thread thd, boolean daemon)
public static final void joinAndInterrupt(Thread thd, int timeout) throws InterruptedException
timeout - how long to wait (0 means forever)InterruptedExceptionpublic static final void dummy(Object o)
Copyright © 2018. All rights reserved.