diff options
-rw-r--r-- | app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java index 24a28619..6d2b21c5 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java @@ -38,6 +38,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -127,12 +128,12 @@ public class NotesRepository { }; // current state of the synchronization - private final Map<Long, Boolean> syncActive = new HashMap<>(); - private final Map<Long, Boolean> syncScheduled = new HashMap<>(); + private final Map<Long, Boolean> syncActive = new ConcurrentHashMap<>(); + private final Map<Long, Boolean> syncScheduled = new ConcurrentHashMap<>(); // list of callbacks for both parts of synchronization - private final Map<Long, List<ISyncCallback>> callbacksPush = new HashMap<>(); - private final Map<Long, List<ISyncCallback>> callbacksPull = new HashMap<>(); + private final Map<Long, List<ISyncCallback>> callbacksPush = new ConcurrentHashMap<>(); + private final Map<Long, List<ISyncCallback>> callbacksPull = new ConcurrentHashMap<>(); public static synchronized NotesRepository getInstance(@NonNull Context context) { |