Ignore:
Timestamp:
2015-09-08T15:20:34+02:00 (9 years ago)
Author:
simon04
Message:

see #11843 - Give all started threads sensible names

Utils#newThreadFactory creates a ThreadFactory to be used when
obtaining a new Executor via Executors.new….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r8540 r8734  
    3838import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3939import org.openstreetmap.josm.tools.CheckParameterUtil;
     40import org.openstreetmap.josm.tools.Utils;
    4041
    4142/**
     
    336337        progressMonitor.setTicksCount(ids.size());
    337338        progressMonitor.setTicks(0);
    338         // The complete set containg all primitives to fetch
     339        // The complete set containing all primitives to fetch
    339340        Set<Long> toFetch = new HashSet<>(ids);
    340341        // Build a list of fetchers that will  download smaller sets containing only MAX_IDS_PER_REQUEST (200) primitives each.
     
    342343        int threadsNumber = Main.pref.getInteger("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS);
    343344        threadsNumber = Math.min(Math.max(threadsNumber, 1), OsmApi.MAX_DOWNLOAD_THREADS);
    344         Executor exec = Executors.newFixedThreadPool(threadsNumber);
     345        Executor exec = Executors.newFixedThreadPool(threadsNumber, Utils.newThreadFactory(getClass() + "-%d", Thread.NORM_PRIORITY));
    345346        CompletionService<FetchResult> ecs = new ExecutorCompletionService<>(exec);
    346347        List<Future<FetchResult>> jobs = new ArrayList<>();
Note: See TracChangeset for help on using the changeset viewer.