/[schmitzm]/branches/2.4.x/src/skrueger/geotools/RenderingExecutor.java
ViewVC logotype

Diff of /branches/2.4.x/src/skrueger/geotools/RenderingExecutor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 513 by alfonx, Mon Nov 9 11:17:34 2009 UTC revision 524 by alfonx, Wed Nov 18 09:56:47 2009 UTC
# Line 261  public class RenderingExecutor { Line 261  public class RenderingExecutor {
261       *         rejected       *         rejected
262       */       */
263      public synchronized boolean submit(ReferencedEnvelope envelope, Rectangle paintArea, Graphics2D graphics, final GTRenderer renderer) {      public synchronized boolean submit(ReferencedEnvelope envelope, Rectangle paintArea, Graphics2D graphics, final GTRenderer renderer) {
264          if (!isRunning() || cancelLatch.getCount() > 0) {          if (!isRunning()) {
265              try {  //            try {
266                  // wait for any cancelled task to finish its shutdown  //                // wait for any cancelled task to finish its shutdown
267                  cancelLatch.await();  //                cancelLatch.await();
268              } catch (InterruptedException ex) {  //            } catch (InterruptedException ex) {
269                  return false;  //                return false;
270              }  //            }
271    
272              task = new Task(envelope, paintArea, graphics, renderer);              task = new Task(envelope, paintArea, graphics, renderer);
273              taskRunning.set(true);              taskRunning.set(true);
# Line 291  public class RenderingExecutor { Line 291  public class RenderingExecutor {
291      public synchronized void cancelTask() {      public synchronized void cancelTask() {
292          if (isRunning()) {          if (isRunning()) {
293              task.cancel();              task.cancel();
294              cancelLatch = new CountDownLatch(1);              
295                // Cancelling to often... can that be the reason?
296                if (cancelLatch.getCount() < 1) {
297                    cancelLatch = new CountDownLatch(1);
298                }
299          }          }
300      }      }
301    
# Line 343  public class RenderingExecutor { Line 347  public class RenderingExecutor {
347              watchExecutor.shutdownNow();              watchExecutor.shutdownNow();
348          }          }
349      }      }
350        
351        public void dispose() {
352            taskExecutor.shutdownNow();
353            watchExecutor.shutdownNow();
354        }
355  }  }
356    

Legend:
Removed from v.513  
changed lines
  Added in v.524

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26