Changeset 32007 in osm for applications/viewer/jmapviewer/src/org/openstreetmap/gui
- Timestamp:
- 2016-01-19T00:46:03+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
r31790 r32007 10 10 import java.util.Map; 11 11 import java.util.Map.Entry; 12 import java.util.concurrent.Executor;13 12 import java.util.concurrent.Executors; 13 import java.util.concurrent.ThreadPoolExecutor; 14 14 15 15 import org.openstreetmap.gui.jmapviewer.interfaces.TileJob; … … 23 23 */ 24 24 public class OsmTileLoader implements TileLoader { 25 private static final Executor jobDispatcher = Executors.newSingleThreadExecutor();25 private static final ThreadPoolExecutor jobDispatcher = (ThreadPoolExecutor) Executors.newFixedThreadPool(3); 26 26 27 27 private final class OsmTileJob implements TileJob { … … 184 184 @Override 185 185 public void cancelOutstandingTasks() { 186 // intentionally left empty - OsmTileLoader doesn't maintain queue 186 jobDispatcher.getQueue().clear(); 187 } 188 189 /** 190 * Sets the maximum number of concurrent connections the tile loader will do 191 * @param num number of conncurent connections 192 */ 193 public static void setConcurrentConnections(int num) { 194 jobDispatcher.setMaximumPoolSize(num); 187 195 } 188 196 }
Note:
See TracChangeset
for help on using the changeset viewer.