Merge remote-tracking branch 'origin/main' into 1.18
This commit is contained in:
commit
558ced7497
|
|
@ -31,7 +31,7 @@ public class PackResourcesCacheEngine {
|
||||||
private final Map<PackType, Set<String>> namespacesByType;
|
private final Map<PackType, Set<String>> namespacesByType;
|
||||||
private final Set<CachedResourcePath> containedPaths;
|
private final Set<CachedResourcePath> containedPaths;
|
||||||
private final EnumMap<PackType, Map<String, List<CachedResourcePath>>> resourceListings;
|
private final EnumMap<PackType, Map<String, List<CachedResourcePath>>> resourceListings;
|
||||||
private CompletableFuture<Void> cacheFuture;
|
private volatile CompletableFuture<Void> cacheFuture;
|
||||||
|
|
||||||
public PackResourcesCacheEngine(Function<PackType, Set<String>> namespacesRetriever, BiFunction<PackType, String, Path> basePathRetriever) {
|
public PackResourcesCacheEngine(Function<PackType, Set<String>> namespacesRetriever, BiFunction<PackType, String, Path> basePathRetriever) {
|
||||||
this.namespacesByType = new EnumMap<>(PackType.class);
|
this.namespacesByType = new EnumMap<>(PackType.class);
|
||||||
|
|
@ -114,8 +114,12 @@ public class PackResourcesCacheEngine {
|
||||||
|
|
||||||
private void awaitLoad() {
|
private void awaitLoad() {
|
||||||
if(this.cacheFuture != null) {
|
if(this.cacheFuture != null) {
|
||||||
this.cacheFuture.join();
|
synchronized (this) {
|
||||||
this.cacheFuture = null;
|
if(this.cacheFuture != null) {
|
||||||
|
this.cacheFuture.join();
|
||||||
|
this.cacheFuture = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user