Fix locking on the same lock that is used for loading causes the server to freeze
This commit is contained in:
parent
86b7e752ee
commit
5e17df6b2a
|
@ -70,6 +70,7 @@ import java.util.stream.Stream;
|
||||||
*/
|
*/
|
||||||
@DebugDump
|
@DebugDump
|
||||||
public class BlueMapService implements Closeable {
|
public class BlueMapService implements Closeable {
|
||||||
|
|
||||||
private final ServerInterface serverInterface;
|
private final ServerInterface serverInterface;
|
||||||
private final BlueMapConfigProvider configs;
|
private final BlueMapConfigProvider configs;
|
||||||
|
|
||||||
|
@ -116,7 +117,7 @@ public class BlueMapService implements Closeable {
|
||||||
id = worldIds.get(worldFolder);
|
id = worldIds.get(worldFolder);
|
||||||
if (id != null) return id;
|
if (id != null) return id;
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (worldIds) {
|
||||||
// check again if another thread has already added the world
|
// check again if another thread has already added the world
|
||||||
id = worldIds.get(worldFolder);
|
id = worldIds.get(worldFolder);
|
||||||
if (id != null) return id;
|
if (id != null) return id;
|
||||||
|
|
Loading…
Reference in New Issue