From: Keith Packard Date: Tue, 27 Mar 2012 05:05:04 +0000 (-0700) Subject: altosui: Use ConcurrentHashMap for maps X-Git-Tag: 1.0.9.4~51 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c2550d72aee371676d2f09316051567681e53a7c altosui: Use ConcurrentHashMap for maps This data structure is accessed by multiple threads, so it needs to be re-entrant. Signed-off-by: Keith Packard --- diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index c258b3e5..63995c40 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -31,6 +31,7 @@ import java.util.prefs.*; import java.lang.Math; import java.awt.geom.Point2D; import java.awt.geom.Line2D; +import java.util.concurrent.*; public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { // preferred vertical step in a tile in naut. miles @@ -110,7 +111,7 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { return latlng(pt, scale_x, scale_y); } - HashMap mapTiles = new HashMap(); + ConcurrentHashMap mapTiles = new ConcurrentHashMap(); Point2D.Double centre; private Point2D.Double tileCoordOffset(Point p) {