public final class Threads extends Object
| 构造器和说明 |
|---|
Threads() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getStackFrame(int depth)
获取栈帧
|
static String |
getStackTrace() |
static String |
getStackTrace(Thread thread) |
static void |
interruptIfNecessary(Throwable t) |
static boolean |
isStopped(Thread thread)
Returns the thread is whether stopped
|
static Thread |
newThread(String name,
boolean daemon,
int priority,
Runnable run,
org.slf4j.Logger logger)
New thread
|
static void |
stopThread(Thread thread,
long joinMillis)
Stops the thread
|
static boolean |
waitUntil(int round,
long[] sleepMillis,
boolean caught,
BooleanSupplier supplier) |
static boolean |
waitUntil(int round,
long[] sleepMillis,
BooleanSupplier supplier) |
public static Thread newThread(String name, boolean daemon, int priority, Runnable run, org.slf4j.Logger logger)
name - the thread namedaemon - the daemonpriority - the priorityrun - the runnablelogger - the uncaught exception handler loggerpublic static boolean isStopped(Thread thread)
thread - the threadtrue if the thread is stoppedpublic static void stopThread(Thread thread, long joinMillis)
thread - the threadjoinMillis - the joinMillispublic static void interruptIfNecessary(Throwable t)
public static String getStackFrame(int depth)
depth - the depthpublic static String getStackTrace()
public static boolean waitUntil(int round,
long[] sleepMillis,
BooleanSupplier supplier)
public static boolean waitUntil(int round,
long[] sleepMillis,
boolean caught,
BooleanSupplier supplier)
Copyright © 2024. All rights reserved.