Changeset 16958 in josm
- Timestamp:
- 2020-08-29T09:28:23+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/spi/lifecycle/Lifecycle.java
r14140 r16958 6 6 import java.util.concurrent.ExecutionException; 7 7 import java.util.concurrent.ExecutorService; 8 import java.util.concurrent. Executors;8 import java.util.concurrent.ForkJoinPool; 9 9 import java.util.concurrent.Future; 10 10 11 11 import org.openstreetmap.josm.tools.JosmRuntimeException; 12 import org.openstreetmap.josm.tools.Logging;13 import org.openstreetmap.josm.tools.Utils;14 12 import org.openstreetmap.josm.tools.bugreport.BugReport; 15 13 … … 73 71 // Initializes tasks to be executed (in parallel) by a ExecutorService 74 72 try { 75 ExecutorService service = Executors.newFixedThreadPool( 76 Runtime.getRuntime().availableProcessors(), Utils.newThreadFactory("main-init-%d", Thread.NORM_PRIORITY)); 73 ExecutorService service = ForkJoinPool.commonPool(); 77 74 for (Future<Void> i : service.invokeAll(initSequence.parallelInitializationTasks())) { 78 75 i.get(); … … 81 78 initSequence.asynchronousRunnableTasks().forEach(service::submit); 82 79 initSequence.asynchronousCallableTasks().forEach(service::submit); 83 try {84 service.shutdown();85 } catch (SecurityException e) {86 Logging.log(Logging.LEVEL_ERROR, "Unable to shutdown executor service", e);87 }88 80 } catch (InterruptedException | ExecutionException ex) { 89 81 throw new JosmRuntimeException(ex);
Note:
See TracChangeset
for help on using the changeset viewer.