public final class Threads extends Object
| 构造器和说明 |
|---|
Threads() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
interruptIfNecessary(Throwable t) |
static boolean |
isStopped(Thread thread)
Returns the thread is whether stopped
|
static Thread |
newThread(Runnable run)
New thread
|
static Thread |
newThread(String name,
boolean daemon,
int priority,
Runnable run)
New thread
|
static void |
stopThread(Thread thread,
int sleepCount,
long sleepMillis,
long joinMillis)
Stops the thread
|
public static Thread newThread(Runnable run)
run - the runnablepublic static Thread newThread(String name, boolean daemon, int priority, Runnable run)
name - the thread namedaemon - the daemonpriority - the priorityrun - the runnablepublic static boolean isStopped(Thread thread)
thread - the threadtrue if the thread is stoppedpublic static void stopThread(Thread thread, int sleepCount, long sleepMillis, long joinMillis)
thread - the threadsleepCount - the sleepCountsleepMillis - the sleepMillisjoinMillis - the joinMillispublic static void interruptIfNecessary(Throwable t)
Copyright © 2023. All rights reserved.