Skip to content

Commit

Permalink
fix: EFM v2 Monitor to use ConcurrentHashMap instead of HashMap to fi…
Browse files Browse the repository at this point in the history
…x ConcurrentModificationException (#586)
  • Loading branch information
aaronchung-bitquill authored Jun 10, 2024
1 parent f377729 commit 0093569
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.util.Map;
import java.util.Properties;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
Expand All @@ -65,7 +66,7 @@ public class Monitor implements IMonitor {
protected static final Executor ABORT_EXECUTOR = Executors.newSingleThreadExecutor();

private final Queue<WeakReference<MonitorConnectionContext>> activeContexts = new ConcurrentLinkedQueue<>();
private final HashMap<Long, Queue<WeakReference<MonitorConnectionContext>>> newContexts = new HashMap<>();
private final Map<Long, Queue<WeakReference<MonitorConnectionContext>>> newContexts = new ConcurrentHashMap<>();

private final AtomicBoolean stopped = new AtomicBoolean(false);
private Connection monitoringConn = null;
Expand Down

0 comments on commit 0093569

Please sign in to comment.