mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-08 17:07:38 +00: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 ce915fe04dd83676ae0045b3a675788f486e2cc6)
This commit is contained in:
parent
66b79b4ea2
commit
7876ab825e
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user