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
1 changed files with 2 additions and 1 deletions

View File

@ -70,6 +70,7 @@ import java.util.stream.Stream;
*/
@DebugDump
public class BlueMapService implements Closeable {
private final ServerInterface serverInterface;
private final BlueMapConfigProvider configs;
@ -116,7 +117,7 @@ public class BlueMapService implements Closeable {
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;