Fix missing static imports of TimeUnit

This commit is contained in:
P0nk
2021-09-10 19:18:20 +02:00
parent cdc17ef3dd
commit 8b60684103
10 changed files with 40 additions and 28 deletions

View File

@@ -21,6 +21,9 @@ package server;
import java.util.concurrent.*;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
/**
* @author Ronan
*/
@@ -53,13 +56,13 @@ public class ThreadManager {
RejectedExecutionHandler reh = new RejectedExecutionHandlerImpl();
ThreadFactory tf = Executors.defaultThreadFactory();
tpe = new ThreadPoolExecutor(20, 1000, 77, TimeUnit.SECONDS, new ArrayBlockingQueue<>(50), tf, reh);
tpe = new ThreadPoolExecutor(20, 1000, 77, SECONDS, new ArrayBlockingQueue<>(50), tf, reh);
}
public void stop() {
tpe.shutdown();
try {
tpe.awaitTermination(5, TimeUnit.MINUTES);
tpe.awaitTermination(5, MINUTES);
} catch (InterruptedException ie) {
}
}