- 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;
- }