From ffa369d2753f97a6c217051611c8a8dd2ce26d47 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 2 Aug 2018 20:35:44 +0200 Subject: [PATCH] Fix CME in storage cache flush. Fixes #1930 --- .../refinedstorage/apiimpl/storage/StorageCacheFluid.java | 2 +- .../refinedstorage/apiimpl/storage/StorageCacheItem.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheFluid.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheFluid.java index 0393c8e3b..1900f12a4 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheFluid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheFluid.java @@ -77,7 +77,7 @@ public class StorageCacheFluid implements IStorageCache { } @Override - public void flush() { + public synchronized void flush() { if (!batchedChanges.isEmpty()) { batchedChanges.forEach(c -> listeners.forEach(l -> l.onChanged(c.getKey(), c.getValue()))); batchedChanges.clear(); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheItem.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheItem.java index ec08d38ac..d3e7c3120 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheItem.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageCacheItem.java @@ -79,7 +79,7 @@ public class StorageCacheItem implements IStorageCache { } @Override - public void flush() { + public synchronized void flush() { if (!batchedChanges.isEmpty()) { batchedChanges.forEach(c -> listeners.forEach(l -> l.onChanged(c.getKey(), c.getValue()))); batchedChanges.clear();