From ce915fe04dd83676ae0045b3a675788f486e2cc6 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 12 Sep 2021 11:36:36 +0100 Subject: [PATCH] Make blocking executor a fair policy Safer if we're submitting lots of chunks for recursive operations. These chunks should be handled in the order they're submitted so we don't handle a chunk that's been submitted twice (possible) in the wrong order --- .../src/main/java/com/fastasyncworldedit/core/FaweCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java index 3b752e356..ca5104e8f 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweCache.java @@ -559,7 +559,7 @@ public enum FaweCache implements Trimable { */ public ThreadPoolExecutor newBlockingExecutor() { int nThreads = Settings.IMP.QUEUE.PARALLEL_THREADS; - ArrayBlockingQueue queue = new ArrayBlockingQueue<>(nThreads); + ArrayBlockingQueue queue = new ArrayBlockingQueue<>(nThreads, true); return new ThreadPoolExecutor(nThreads, nThreads, 0L, TimeUnit.MILLISECONDS, queue, Executors.defaultThreadFactory(),