From 54f5c1636f9f517cb41de21c7ffcf4a6c805fbd5 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Fri, 7 Apr 2023 11:32:41 +0200 Subject: [PATCH] Fix for older jdk versions --- src/main/java/fr/ntr/Main.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index fc7d4da..666ded6 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -1,5 +1,7 @@ package fr.ntr; +import fr.ntr.scheduler.MaxSNR; +import fr.ntr.scheduler.ProportionalFair; import fr.ntr.scheduler.RoundRobin; import fr.ntr.scheduler.Scheduler; @@ -13,6 +15,7 @@ import java.util.Objects; import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; public class Main { @@ -100,7 +103,15 @@ public class Main { System.exit(1); } } - executor.close(); + executor.shutdown(); + try { + executor.awaitTermination(2, TimeUnit.MINUTES); + } + catch (InterruptedException e) { + e.printStackTrace(); + } + executor.shutdownNow(); + System.out.println("Executor closed"); } else {