Changeset 8526 in josm for trunk/src/org/openstreetmap/josm/data/cache
- Timestamp:
- 2015-06-24T20:57:43+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r8513 r8526 193 193 } 194 194 // object not in cache, so submit work to separate thread 195 getDownloadExecutor().execute(this);195 downloadJobExecutor.execute(this); 196 196 } 197 197 } … … 230 230 protected String getServerKey() { 231 231 return getUrl().getHost(); 232 }233 234 /**235 * this needs to be non-static, so it can be overridden by subclasses236 */237 protected ThreadPoolExecutor getDownloadExecutor() {238 return downloadJobExecutor;239 232 } 240 233 … … 506 499 */ 507 500 public void cancelOutstandingTasks() { 508 ThreadPoolExecutor downloadExecutor = getDownloadExecutor(); 509 for (Runnable r: downloadExecutor.getQueue()) { 510 if (downloadExecutor.remove(r)) { 511 if (r instanceof JCSCachedTileLoaderJob) { 512 ((JCSCachedTileLoaderJob<?, ?>) r).handleJobCancellation(); 513 } 501 for(Runnable r: downloadJobExecutor.getQueue()) { 502 if (downloadJobExecutor.remove(r) && r instanceof JCSCachedTileLoaderJob) { 503 ((JCSCachedTileLoaderJob<?, ?>) r).handleJobCancellation(); 514 504 } 515 505 }
Note:
See TracChangeset
for help on using the changeset viewer.