Esempio n. 1
0
  @Override
  public void run() {

    while (true) {
      //			log.debug("Status available="+availableSlots+" used="+usedSlots+" queue="+queue.size());
      if (availableSlots.intValue() > usedSlots.intValue() && queue.size() > 0) {
        usedSlots.incrementAndGet();
        AnalysisRunner currentRun = queue.removeFirst();
        currentRun.addAnalysisListener(this);
        Thread t = new Thread(currentRun);
        t.start();
      }

      try {
        Thread.sleep(500);
      } catch (InterruptedException e) {
      }
    }
  }
  /**
   * Removes the markers from the given input
   *
   * @param input the input that has a related resource that should have markers removed
   */
  private void removeMarkersFromInput(IEditorInput input) {
    if (input != null && PyDevBuilderPrefPage.getAnalyzeOnlyActiveEditor()) {
      IFile relatedFile = (IFile) input.getAdapter(IFile.class);

      if (relatedFile != null && relatedFile.exists()) {
        // when disposing, remove all markers
        AnalysisRunner.deleteMarkers(relatedFile);
      }
    }
  }