From: Jim Procter Date: Mon, 3 Aug 2015 14:44:19 +0000 (+0100) Subject: JAL-1821 avoid race condition when multiple structures loaded in Jmol where getFiles... X-Git-Tag: Release_2_10_0~558 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e02b02024dfd55916e3d96e7ae2166478b8a6688;p=jalview.git JAL-1821 avoid race condition when multiple structures loaded in Jmol where getFiles() returns {null} and waitUntilLoad times out rather than performs superposition --- 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;