3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-07-22 18:18:03 +02:00

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

(cherry picked from commit ce915fe04d)
Dieser Commit ist enthalten in:
dordsor21 2021-09-12 11:36:36 +01:00
Ursprung 66b79b4ea2
Commit 7876ab825e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -559,7 +559,7 @@ public enum FaweCache implements Trimable {
*/
public ThreadPoolExecutor newBlockingExecutor() {
int nThreads = Settings.IMP.QUEUE.PARALLEL_THREADS;
ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(nThreads);
ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(nThreads, true);
return new ThreadPoolExecutor(nThreads, nThreads,
0L, TimeUnit.MILLISECONDS, queue,
Executors.defaultThreadFactory(),