Ignore:
Timestamp:
2015-09-08T15:20:34+02:00 (4 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….

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

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

    r8510 r8734  
    3030import org.openstreetmap.josm.io.auth.JosmPreferencesCredentialAgent;
    3131import org.openstreetmap.josm.tools.GBC;
     32import org.openstreetmap.josm.tools.Utils;
    3233
    3334/**
     
    4647    public static final IntegerProperty PROP_INTERVAL = new IntegerProperty("message.notifier.interval", 5);
    4748
    48     private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor();
     49    private static final ScheduledExecutorService EXECUTOR =
     50            Executors.newSingleThreadScheduledExecutor(Utils.newThreadFactory("message-notifier-%d", Thread.NORM_PRIORITY));
    4951
    5052    private static final Runnable WORKER = new Worker();
  • 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.