3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-24 18:10:08 +01:00

use concurrent hashmap for thread processor cache

Dieser Commit ist enthalten in:
dordsor21 2020-10-04 18:34:15 +01:00
Ursprung 9f232a9690
Commit fc606ff5ff
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -12,9 +12,9 @@ import com.sk89q.worldedit.extent.Extent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.Map; import java.util.Map;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -22,7 +22,7 @@ import java.util.function.Supplier;
public class MultiBatchProcessor implements IBatchProcessor { public class MultiBatchProcessor implements IBatchProcessor {
private IBatchProcessor[] processors; private IBatchProcessor[] processors;
private final LoadingCache<Class<?>, Map<Long, Filter>> classToThreadIdToFilter = private final LoadingCache<Class<?>, Map<Long, Filter>> classToThreadIdToFilter =
FaweCache.IMP.createCache((Supplier<Map<Long, Filter>>) HashMap::new); FaweCache.IMP.createCache((Supplier<Map<Long, Filter>>) ConcurrentHashMap::new);
public MultiBatchProcessor(IBatchProcessor... processors) { public MultiBatchProcessor(IBatchProcessor... processors) {
this.processors = processors; this.processors = processors;