|
|
|
@ -5,6 +5,7 @@ import com.github.dynamic.threadpool.common.toolkit.Assert;
|
|
|
|
|
import com.github.dynamic.threadpool.starter.alarm.ThreadPoolAlarm;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -267,7 +268,8 @@ public class ThreadPoolBuilder implements Builder<ThreadPoolExecutor> {
|
|
|
|
|
.setTimeUnit(builder.timeUnit);
|
|
|
|
|
|
|
|
|
|
if (builder.isCustomPool) {
|
|
|
|
|
initParam.setThreadPoolId(builder.threadPoolId);
|
|
|
|
|
String threadPoolId = Optional.ofNullable(builder.threadPoolId).orElse(builder.threadNamePrefix);
|
|
|
|
|
initParam.setThreadPoolId(threadPoolId);
|
|
|
|
|
ThreadPoolAlarm threadPoolAlarm = new ThreadPoolAlarm(builder.isAlarm, builder.capacityAlarm, builder.livenessAlarm);
|
|
|
|
|
initParam.setThreadPoolAlarm(threadPoolAlarm);
|
|
|
|
|
}
|
|
|
|
|