diff --git a/pom.xml b/pom.xml
index 4ce8b88acc..345d639366 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.xiaoleilu
hutool
- 2.0.1
+ 2.0.2
hutool
提供最基础的工具类
https://github.com/looly/hutool
diff --git a/src/main/java/com/xiaoleilu/hutool/ThreadUtil.java b/src/main/java/com/xiaoleilu/hutool/ThreadUtil.java
index 3651b0e9b1..0fa189d9f5 100644
--- a/src/main/java/com/xiaoleilu/hutool/ThreadUtil.java
+++ b/src/main/java/com/xiaoleilu/hutool/ThreadUtil.java
@@ -7,6 +7,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
+import java.util.concurrent.ThreadPoolExecutor;
import com.xiaoleilu.hutool.exceptions.UtilException;
@@ -54,6 +55,14 @@ public static ExecutorService newExecutor(){
return Executors.newCachedThreadPool();
}
+ /**
+ * 获得一个新的线程池,只有单个线程
+ * @return ExecutorService
+ */
+ public static ExecutorService newSingleExecutor(){
+ return Executors.newSingleThreadExecutor();
+ }
+
/**
* 执行异步方法
* @param runnable 需要执行的方法体
@@ -97,6 +106,11 @@ public static CompletionService newCompletionService(ExecutorService execu
return new ExecutorCompletionService(executor);
}
+ /**
+ * 新建一个CountDownLatch
+ * @param threadCount 线程数量
+ * @return CountDownLatch
+ */
public static CountDownLatch newCountDownLatch(int threadCount) {
return new CountDownLatch(threadCount);
}