summaryrefslogtreecommitdiff
path: root/altosuilib/AltosUIMapView.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-14 18:51:25 -0700
committerKeith Packard <keithp@keithp.com>2014-06-14 18:55:23 -0700
commit5392ee3c5328f8384ed30a2d147e4be96075e064 (patch)
treecbf61a120fc54681ca52acc3d159052f3d15691f /altosuilib/AltosUIMapView.java
parent23708b4760250f55e8e3b1a0141df9a9ee17a936 (diff)
altosuilib: Serialize access to async tile notify function in preload
This ensures that we see each tile getting downloaded and don't mis-count, which would result in wedging the process Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIMapView.java')
-rw-r--r--altosuilib/AltosUIMapView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/altosuilib/AltosUIMapView.java b/altosuilib/AltosUIMapView.java
index 4df178e2..a14fde65 100644
--- a/altosuilib/AltosUIMapView.java
+++ b/altosuilib/AltosUIMapView.java
@@ -387,7 +387,7 @@ public class AltosUIMapView extends Component implements MouseMotionListener, Mo
}
/* AltosUIMapTileListener methods */
- public void notify_tile(AltosUIMapTile tile, int status) {
+ public synchronized void notify_tile(AltosUIMapTile tile, int status) {
for (Point point : tiles.keySet()) {
if (tile == tiles.get(point)) {
Point screen = transform.screen(point);
@@ -399,7 +399,7 @@ public class AltosUIMapView extends Component implements MouseMotionListener, Mo
public AltosUIMapCache cache() { return cache; }
/* AltosUIMapStoreListener methods */
- public void notify_store(AltosUIMapStore store, int status) {
+ public synchronized void notify_store(AltosUIMapStore store, int status) {
if (load_listener != null) {
for (AltosUIMapTile tile : tiles.values())
if (store.equals(tile.store))