- Timestamp:
- 2016-01-05T23:27:01+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r9242 r9324 19 19 import java.util.concurrent.CompletionService; 20 20 import java.util.concurrent.ExecutionException; 21 import java.util.concurrent.Executor;22 21 import java.util.concurrent.ExecutorCompletionService; 22 import java.util.concurrent.ExecutorService; 23 23 import java.util.concurrent.Executors; 24 24 import java.util.concurrent.Future; … … 325 325 int threadsNumber = Main.pref.getInteger("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS); 326 326 threadsNumber = Math.min(Math.max(threadsNumber, 1), OsmApi.MAX_DOWNLOAD_THREADS); 327 Executor exec = Executors.newFixedThreadPool(threadsNumber, Utils.newThreadFactory(getClass() + "-%d", Thread.NORM_PRIORITY)); 327 final ExecutorService exec = Executors.newFixedThreadPool( 328 threadsNumber, Utils.newThreadFactory(getClass() + "-%d", Thread.NORM_PRIORITY)); 328 329 CompletionService<FetchResult> ecs = new ExecutorCompletionService<>(exec); 329 330 List<Future<FetchResult>> jobs = new ArrayList<>(); … … 347 348 } 348 349 } 349 // Cancel requests if the user choosed to 350 exec.shutdown(); 351 // Cancel requests if the user chose to 350 352 if (isCanceled()) { 351 353 for (Future<FetchResult> job : jobs) {
Note:
See TracChangeset
for help on using the changeset viewer.