From e02b02024dfd55916e3d96e7ae2166478b8a6688 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 3 Aug 2015 15:44:19 +0100 Subject: [PATCH] JAL-1821 avoid race condition when multiple structures loaded in Jmol where getFiles() returns {null} and waitUntilLoad times out rather than performs superposition --- src/jalview/ext/jmol/JalviewJmolBinding.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index c7496df..abd742e 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -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; -- 1.7.10.2