mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-21 20:35:58 +03:00
Use ConcurrentHashMap for sync related states
Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
parent
f9ccd7b95b
commit
c7132087c7
1 changed files with 5 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue