Fix locking on the same lock that is used for loading causes the server to freeze

This commit is contained in:
Lukas Rieger (Blue) 2023-03-13 19:30:31 +01:00
parent 86b7e752ee
commit 5e17df6b2a
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -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;