mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
64e4d9db7b
commit
5c60b626cd
@ -29,20 +29,18 @@ public class ThreadUtilTest {
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Disabled
|
||||||
public void testNewFixedExecutor(){
|
public void testNewFixedExecutor(){
|
||||||
|
final ThreadPoolExecutor executor = ThreadUtil.newFixedExecutor(1, 2, "test-", true);
|
||||||
ThreadPoolExecutor executor = ThreadUtil.newFixedExecutor(1, 2, "test-", true);
|
|
||||||
|
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
executor.execute(()->{
|
executor.execute(()->{
|
||||||
Console.log("执行任务1");
|
Console.log("执行任务1");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testNewExecutorByBlockingCoefficient(){
|
public void testNewExecutorByBlockingCoefficient(){
|
||||||
ThreadPoolExecutor executor = ThreadUtil.newExecutorByBlockingCoefficient(0.5f);
|
final ThreadPoolExecutor executor = ThreadUtil.newExecutorByBlockingCoefficient(0.5f);
|
||||||
Console.log(executor.getCorePoolSize());
|
Console.log(executor.getCorePoolSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user