JAL-4160 JAL-4195 wait around until alignFrame calculators are finished before trying... patch/JAL-4195_calcWorker_for_2_11_2_6
authorJames Procter <j.procter@dundee.ac.uk>
Tue, 6 Jun 2023 16:59:35 +0000 (17:59 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Wed, 7 Jun 2023 11:19:41 +0000 (12:19 +0100)
src/jalview/workers/AlignCalcManager.java

index 08ef3a2..d81db8c 100644 (file)
@@ -200,11 +200,20 @@ public class AlignCalcManager implements AlignCalcManagerI
   @Override
   public boolean isWorking()
   {
+    boolean working=false;
     synchronized (inProgress)
     {
       // System.err.println("isWorking "+hashCode());
-      return inProgress.size() > 0;
+      working |= inProgress.size() > 0;
     }
+    synchronized (updating)
+    {
+      for (List<AlignCalcWorkerI> workers : updating.values())
+      {
+        working |= workers.size() > 0;
+      }
+    }
+    return working;
   }
 
   @Override