Ignore:
Timestamp:
2015-09-08T15:20:34+02:00 (10 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/data
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r8673 r8734  
    7777            // make queue of LIFO type - so recently requested tiles will be loaded first (assuming that these are which user is waiting to see)
    7878            new LinkedBlockingDeque<Runnable>(),
    79             Utils.getNamedThreadFactory("JCS downloader")
     79            Utils.newThreadFactory("JCS-downloader-%d", Thread.NORM_PRIORITY)
    8080            );
    8181
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java

    r8624 r8734  
    5050     * and for TMS imagery
    5151     */
    52     private static ThreadPoolExecutor DEFAULT_DOWNLOAD_JOB_DISPATCHER = getNewThreadPoolExecutor("TMS downloader");
     52    private static ThreadPoolExecutor DEFAULT_DOWNLOAD_JOB_DISPATCHER = getNewThreadPoolExecutor("TMS-downloader-%d");
    5353
    5454
     
    7474
    7575    /**
    76      * @param name name of the threads
     76     * @param nameFormat see {@link Utils#newThreadFactory(String, int)}
    7777     * @param workers number of worker thread to keep
    7878     * @return new ThreadPoolExecutor that will use a @see HostLimitQueue based queue
    7979     */
    80     public static ThreadPoolExecutor getNewThreadPoolExecutor(String name, int workers) {
     80    public static ThreadPoolExecutor getNewThreadPoolExecutor(String nameFormat, int workers) {
    8181        return new ThreadPoolExecutor(
    8282                workers, // keep the thread number constant
     
    8585                TimeUnit.SECONDS,
    8686                new HostLimitQueue(HOST_LIMIT.get().intValue()),
    87                 Utils.getNamedThreadFactory(name)
     87                Utils.newThreadFactory(nameFormat, Thread.NORM_PRIORITY)
    8888                );
    8989    }
  • trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoader.java

    r8624 r8734  
    3434
    3535        super(listener, cache, connectTimeout, readTimeout, headers);
    36         setDownloadExecutor(TMSCachedTileLoader.getNewThreadPoolExecutor("WMS downloader", THREAD_LIMIT.get()));
     36        setDownloadExecutor(TMSCachedTileLoader.getNewThreadPoolExecutor("WMS-downloader-%d", THREAD_LIMIT.get()));
    3737    }
    3838
  • trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java

    r8510 r8734  
    3232
    3333    private static final Pair<Integer, ExecutorService> THREAD_POOL =
    34             Utils.newThreadPool("multipolygon_creation.numberOfThreads");
     34            Utils.newThreadPool("multipolygon_creation.numberOfThreads", "multipolygon-builder-%d", Thread.NORM_PRIORITY);
    3535
    3636    /**
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8632 r8734  
    8787
    8888    private static final Pair<Integer, ExecutorService> THREAD_POOL =
    89             Utils.newThreadPool("mappaint.StyledMapRenderer.style_creation.numberOfThreads");
     89            Utils.newThreadPool("mappaint.StyledMapRenderer.style_creation.numberOfThreads", "styled-map-renderer-%d", Thread.NORM_PRIORITY);
    9090
    9191    /**
Note: See TracChangeset for help on using the changeset viewer.