JAL-1821 avoid race condition when multiple structures loaded in Jmol where getFiles...
authorJim Procter <jprocter@issues.jalview.org>
Mon, 3 Aug 2015 14:44:19 +0000 (15:44 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 3 Aug 2015 14:44:19 +0000 (15:44 +0100)
src/jalview/ext/jmol/JalviewJmolBinding.java

index c7496df..abd742e 100644 (file)
@@ -259,8 +259,17 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
   public void superposeStructures(AlignmentI[] _alignment,
           int[] _refStructure, ColumnSelection[] _hiddenCols)
   {
+    while (viewer.isScriptExecuting())
+    {
+      try
+      {
+        Thread.sleep(10);
+      } catch (InterruptedException i)
+      {
+      }
+      ;
+    }
     String[] files = getPdbFile();
-
     if (!waitForFileLoad(files))
     {
       return;