From 5e17df6b2ae2eb59ee4b5c727da2b324e1223959 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Mon, 13 Mar 2023 19:30:31 +0100 Subject: [PATCH] Fix locking on the same lock that is used for loading causes the server to freeze --- .../java/de/bluecolored/bluemap/common/BlueMapService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java index d7dfe850..3e1746c0 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java @@ -70,6 +70,7 @@ */ @DebugDump public class BlueMapService implements Closeable { + private final ServerInterface serverInterface; private final BlueMapConfigProvider configs; @@ -116,7 +117,7 @@ public String getWorldId(Path worldFolder) throws IOException { id = worldIds.get(worldFolder); if (id != null) return id; - synchronized (this) { + synchronized (worldIds) { // check again if another thread has already added the world id = worldIds.get(worldFolder); if (id != null) return id;