tmf: Avoid hanging when waiting on a cancelled analysis
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / analysis / TmfAbstractAnalysisModule.java
index 4e90fe8c91668ea82b5a1320033b5f5b57c7dc08..bfda90f42fdfbbcfe075c4864af858c3097af5eb 100644 (file)
@@ -180,6 +180,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
      * Set the countdown latch back to 1 so the analysis can be executed again
      */
     protected void resetAnalysis() {
+        fFinishedLatch.countDown();
         fFinishedLatch = new CountDownLatch(1);
     }
 
@@ -313,8 +314,8 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
     @Override
     public boolean waitForCompletion(IProgressMonitor monitor) {
         try {
-            while (!fFinishedLatch.await(1, TimeUnit.MILLISECONDS)) {
-                if (monitor.isCanceled()) {
+            while (!fFinishedLatch.await(500, TimeUnit.MILLISECONDS)) {
+                if (fAnalysisCancelled || monitor.isCanceled()) {
                     fAnalysisCancelled = true;
                     return false;
                 }
This page took 0.024946 seconds and 5 git commands to generate.