From f9ee91f1926857ad0389b23e07f8df4574a6d269 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 24 Sep 2016 15:19:47 +1000 Subject: [PATCH] Remove debug message --- .../main/java/com/boydti/fawe/util/SetQueue.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/util/SetQueue.java b/core/src/main/java/com/boydti/fawe/util/SetQueue.java index 28767a81..fb3969ce 100644 --- a/core/src/main/java/com/boydti/fawe/util/SetQueue.java +++ b/core/src/main/java/com/boydti/fawe/util/SetQueue.java @@ -106,8 +106,18 @@ public class SetQueue { e.printStackTrace(); } if (pool.getQueuedSubmissionCount() != 0 || pool.getRunningThreadCount() != 0 || pool.getQueuedTaskCount() != 0) { - Fawe.debug("Error flushing parallel pool"); - pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS); + if (Fawe.get().isJava8()) { + pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS); + } else { + try { + for (Runnable run : pool.shutdownNow()) { + run.run(); + } + } catch (Throwable e) { + e.printStackTrace(); + } + pool = new ForkJoinPool(); + } } secondLast = System.currentTimeMillis(); } catch (Throwable e) {