X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fworkers%2FInformationThread.java;h=c8084b92914453b61371ca22c1259ecd853a0fe4;hb=6a6fb5010c2cd06b14a1e055eabaeb4848e65d2d;hp=85cd92faa4e40f3b221881720ef60dac26da7281;hpb=b13d4ee2f7839be680d23ce157aff4e204377a8f;p=jalview.git diff --git a/src/jalview/workers/InformationThread.java b/src/jalview/workers/InformationThread.java index 85cd92f..c8084b9 100644 --- a/src/jalview/workers/InformationThread.java +++ b/src/jalview/workers/InformationThread.java @@ -48,73 +48,34 @@ public class InformationThread extends AlignCalcWorker { return; } - if (calcMan.isPending(this)) + if (alignViewport.isClosed()) { + abortAndDestroy(); return; } - calcMan.notifyStart(this); - // long started = System.currentTimeMillis(); - try + AlignmentI alignment = alignViewport.getAlignment(); + int aWidth = alignment == null ? -1 : alignment.getWidth(); + if (aWidth < 0) { - if (calcMan.isPending(this)) - { - // another instance of this is waiting to run - calcMan.workerComplete(this); - return; - } - while (!calcMan.notifyWorking(this)) - { - // another thread in progress, wait my turn - try - { - if (ap != null) - { - ap.paintAlignment(false, false); - } - Thread.sleep(200); - } catch (Exception ex) - { - ex.printStackTrace(); - } - } - if (alignViewport.isClosed()) - { - abortAndDestroy(); - return; - } - - AlignmentI alignment = alignViewport.getAlignment(); - int aWidth = alignment == null ? -1 : alignment.getWidth(); - if (aWidth < 0) - { - calcMan.workerComplete(this); - return; - } + return; + } - /* - * compute information profiles for any HMM consensus sequences - * for the alignment or sub-groups - */ - computeProfiles(alignment); + /* + * compute information profiles for any HMM consensus sequences + * for the alignment or sub-groups + */ + computeProfiles(alignment); - /* - * construct the corresponding annotations - */ - updateAnnotation(); + /* + * construct the corresponding annotations + */ + updateAnnotation(); - if (ap != null) - { - ap.adjustAnnotationHeight(); - ap.paintAlignment(true, true); - } - } catch (OutOfMemoryError error) - { - calcMan.disableWorker(this); - ap.raiseOOMWarning("calculating information", error); - } finally + if (ap != null) { - calcMan.workerComplete(this); + ap.adjustAnnotationHeight(); + ap.paintAlignment(true, true); } }