public class Threads extends Object
| 构造器和说明 |
|---|
Threads() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
gracefulShutdown(ExecutorService pool,
int shutdownTimeout,
int shutdownNowTimeout,
TimeUnit timeUnit)
按照ExecutorService JavaDoc示例代码编写的Graceful Shutdown方法.
|
static void |
normalShutdown(ExecutorService pool,
int timeout,
TimeUnit timeUnit)
直接调用shutdownNow的方法, 有timeout控制.取消在workQueue中Pending的任务,并中断所有阻塞函数.
|
static void |
sleep(long millis)
sleep等待,单位为毫秒,忽略InterruptedException.
|
static void |
sleep(long duration,
TimeUnit unit)
sleep等待,忽略InterruptedException.
|
public static void sleep(long millis)
public static void sleep(long duration,
TimeUnit unit)
public static void gracefulShutdown(ExecutorService pool, int shutdownTimeout, int shutdownNowTimeout, TimeUnit timeUnit)
pool - shutdownTimeout - shutdownNowTimeout - timeUnit - public static void normalShutdown(ExecutorService pool, int timeout, TimeUnit timeUnit)
pool - timeout - timeUnit - Copyright © 2017. All rights reserved.