mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复availableProcessors,潜在的native方法获取CPU个数失败的问题
This commit is contained in:
@@ -2,6 +2,7 @@ package cn.hutool.socket.aio;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.thread.ThreadFactoryBuilder;
|
||||
import cn.hutool.core.util.RuntimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -12,7 +13,7 @@ import java.nio.channels.AsynchronousChannelGroup;
|
||||
public class AioClientTest {
|
||||
public static void main(String[] args) throws IOException {
|
||||
final AsynchronousChannelGroup GROUP = AsynchronousChannelGroup.withFixedThreadPool(//
|
||||
Runtime.getRuntime().availableProcessors(), // 默认线程池大小
|
||||
RuntimeUtil.getProcessorCount(), // 默认线程池大小
|
||||
ThreadFactoryBuilder.create().setNamePrefix("Huool-socket-").build()//
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user