maybe fix concurrency error during world gen shutdown

This commit is contained in:
James Seibel
2025-11-28 16:29:47 -06:00
parent 1c44ef7f0c
commit 4e96728c25
2 changed files with 8 additions and 5 deletions
@@ -134,14 +134,14 @@ public class FullDataSourceProviderV2 implements IDebugRenderable, AutoCloseable
public void addDataSourceUpdateListener(IDataSourceUpdateListenerFunc<FullDataSourceV2> listener)
{
synchronized (this.dataUpdater)
synchronized (this.dataUpdater.dateSourceUpdateListeners)
{
this.dataUpdater.dateSourceUpdateListeners.add(listener);
}
}
public void removeDataSourceUpdateListener(IDataSourceUpdateListenerFunc<FullDataSourceV2> listener)
{
synchronized (this.dataUpdater)
synchronized (this.dataUpdater.dateSourceUpdateListeners)
{
this.dataUpdater.dateSourceUpdateListeners.add(listener);
}
@@ -150,11 +150,14 @@ public class FullDataUpdaterV2 implements IDebugRenderable, AutoCloseable
}
for (IDataSourceUpdateListenerFunc<FullDataSourceV2> listener : this.dateSourceUpdateListeners)
synchronized (this.dateSourceUpdateListeners)
{
if (listener != null)
for (IDataSourceUpdateListenerFunc<FullDataSourceV2> listener : this.dateSourceUpdateListeners)
{
listener.OnDataSourceUpdated(recipientDataSource);
if (listener != null)
{
listener.OnDataSourceUpdated(recipientDataSource);
}
}
}
}