Changeset 36123 in osm


Ignore:
Timestamp:
2023-08-22T23:26:55+02:00 (16 months ago)
Author:
taylor.smock
Message:

pmtiles: Don't create a new ThreadPoolExecutor for every job

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pmtiles/src/main/java/org/openstreetmap/josm/plugins/pmtiles/gui/layers/PMTilesLoader.java

    r36112 r36123  
    66import java.util.Collection;
    77import java.util.HashSet;
     8import java.util.concurrent.ThreadPoolExecutor;
    89
    910import org.apache.commons.jcs3.access.behavior.ICacheAccess;
     
    2425 */
    2526public class PMTilesLoader implements TileLoader {
     27    private static final ThreadPoolExecutor EXECUTOR = TMSCachedTileLoader.getNewThreadPoolExecutor("pmtiles");
    2628    private final Collection<PMTileJob> jobs = new HashSet<>();
    2729    private final ICacheAccess<String, CacheEntry> cache;
     
    4648    @Override
    4749    public TileJob createTileLoaderJob(Tile tile) {
    48         final var job = new PMTileJob(cache, options, TMSCachedTileLoader.getNewThreadPoolExecutor("pmtiles"), header, tile, directoryCache);
     50        final var job = new PMTileJob(cache, options, EXECUTOR, header, tile, directoryCache);
    4951        this.jobs.add(job);
    5052        return job;
Note: See TracChangeset for help on using the changeset viewer.