Skip to content

Commit

Permalink
Use ConcurrentHashMap for static collection of NT sources (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
Starlight220 authored Mar 28, 2023
1 parent 42dcd98 commit 1daf755
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import edu.wpi.first.networktables.NetworkTableInstance;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;

/**
* A source for data in network tables. Data can be a single value or a map of keys to values.
Expand All @@ -28,7 +28,7 @@
*/
public abstract class NetworkTableSource<T> extends AbstractDataSource<T> {

private static final Map<String, NetworkTableSource> sources = new HashMap<>();
private static final Map<String, NetworkTableSource> sources = new ConcurrentHashMap<>();

protected final String fullTableKey;
private int listenerUid = -1;
Expand Down

0 comments on commit 1daf755

Please sign in to comment.