mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
ThreadUtil.newExecutor等方法变更方法签名,返回值变更为ThreadPoolExecutor
This commit is contained in:
parent
a8e959c37c
commit
db5806f0e8
@ -14,6 +14,7 @@
|
|||||||
* 【cache 】 Cache.put变更策略,对于替换的键值对,不清理队列(issue#3618@Github)
|
* 【cache 】 Cache.put变更策略,对于替换的键值对,不清理队列(issue#3618@Github)
|
||||||
* 【core 】 添加 Windows 资源管理器风格字符串比较器(pr#3620@Github)
|
* 【core 】 添加 Windows 资源管理器风格字符串比较器(pr#3620@Github)
|
||||||
* 【core 】 Week.of支持中文名称(issue#3637@Github)
|
* 【core 】 Week.of支持中文名称(issue#3637@Github)
|
||||||
|
* 【core 】 ThreadUtil.newExecutor等方法变更方法签名,返回值变更为ThreadPoolExecutor(pr#1230@Gitee)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【core 】 修复AnnotationUtil可能的空指针错误
|
* 【core 】 修复AnnotationUtil可能的空指针错误
|
||||||
|
@ -54,7 +54,7 @@ public class ThreadUtil {
|
|||||||
*
|
*
|
||||||
* @return ExecutorService
|
* @return ExecutorService
|
||||||
*/
|
*/
|
||||||
public static ExecutorService newExecutor() {
|
public static ThreadPoolExecutor newExecutor() {
|
||||||
return ExecutorBuilder.create().useSynchronousQueue().build();
|
return ExecutorBuilder.create().useSynchronousQueue().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ public class ThreadUtil {
|
|||||||
* @return {@link ThreadPoolExecutor}
|
* @return {@link ThreadPoolExecutor}
|
||||||
* @since 5.4.1
|
* @since 5.4.1
|
||||||
*/
|
*/
|
||||||
public static ExecutorService newExecutor(int corePoolSize, int maximumPoolSize, int maximumQueueSize) {
|
public static ThreadPoolExecutor newExecutor(int corePoolSize, int maximumPoolSize, int maximumQueueSize) {
|
||||||
return ExecutorBuilder.create()
|
return ExecutorBuilder.create()
|
||||||
.setCorePoolSize(corePoolSize)
|
.setCorePoolSize(corePoolSize)
|
||||||
.setMaxPoolSize(maximumPoolSize)
|
.setMaxPoolSize(maximumPoolSize)
|
||||||
@ -147,7 +147,7 @@ public class ThreadUtil {
|
|||||||
* @author luozongle
|
* @author luozongle
|
||||||
* @since 5.8.0
|
* @since 5.8.0
|
||||||
*/
|
*/
|
||||||
public static ExecutorService newFixedExecutor(int nThreads, String threadNamePrefix, boolean isBlocked) {
|
public static ThreadPoolExecutor newFixedExecutor(int nThreads, String threadNamePrefix, boolean isBlocked) {
|
||||||
return newFixedExecutor(nThreads, 1024, threadNamePrefix, isBlocked);
|
return newFixedExecutor(nThreads, 1024, threadNamePrefix, isBlocked);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ public class ThreadUtil {
|
|||||||
* @author luozongle
|
* @author luozongle
|
||||||
* @since 5.8.0
|
* @since 5.8.0
|
||||||
*/
|
*/
|
||||||
public static ExecutorService newFixedExecutor(int nThreads, int maximumQueueSize, String threadNamePrefix, boolean isBlocked) {
|
public static ThreadPoolExecutor newFixedExecutor(int nThreads, int maximumQueueSize, String threadNamePrefix, boolean isBlocked) {
|
||||||
return newFixedExecutor(nThreads, maximumQueueSize, threadNamePrefix,
|
return newFixedExecutor(nThreads, maximumQueueSize, threadNamePrefix,
|
||||||
(isBlocked ? RejectPolicy.BLOCK : RejectPolicy.ABORT).getValue());
|
(isBlocked ? RejectPolicy.BLOCK : RejectPolicy.ABORT).getValue());
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ public class ThreadUtil {
|
|||||||
* @author luozongle
|
* @author luozongle
|
||||||
* @since 5.8.0
|
* @since 5.8.0
|
||||||
*/
|
*/
|
||||||
public static ExecutorService newFixedExecutor(int nThreads,
|
public static ThreadPoolExecutor newFixedExecutor(int nThreads,
|
||||||
int maximumQueueSize,
|
int maximumQueueSize,
|
||||||
String threadNamePrefix,
|
String threadNamePrefix,
|
||||||
RejectedExecutionHandler handler) {
|
RejectedExecutionHandler handler) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user