Changeset 35018 in osm for applications/viewer/jmapviewer/src/org
- Timestamp:
- 2019-05-30T15:33:12+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
r34784 r35018 14 14 import java.util.concurrent.Executors; 15 15 import java.util.concurrent.ThreadPoolExecutor; 16 import java.util.logging.Level; 16 17 17 18 import org.openstreetmap.gui.jmapviewer.interfaces.TileJob; … … 25 26 */ 26 27 public class OsmTileLoader implements TileLoader { 27 private static final ThreadPoolExecutor jobDispatcher = (ThreadPoolExecutor) Executors.newFixedThreadPool(8); 28 /** Setting key for number of threads */ 29 public static final String THREADS_SETTING = "jmapviewer.osm-tile-loader.threads"; 30 private static final int DEFAULT_THREADS_NUMBER = 4; 31 private static int nThreads = DEFAULT_THREADS_NUMBER; 32 static { 33 try { 34 nThreads = FeatureAdapter.getIntSetting(THREADS_SETTING, DEFAULT_THREADS_NUMBER); 35 } catch (Exception e) { 36 FeatureAdapter.getLogger(OsmTileLoader.class.getName()).log(Level.SEVERE, e.getMessage(), e); 37 } 38 } 39 private static final ThreadPoolExecutor jobDispatcher = (ThreadPoolExecutor) Executors.newFixedThreadPool(nThreads); 28 40 29 41 private final class OsmTileJob implements TileJob {
Note:
See TracChangeset
for help on using the changeset viewer.