code: public void execute(final FifoTask<E> task) throws InterruptedException {
          final int id;
          synchronized (this) {
              id = idCounter++;
              taskMap.put(id, task);
              while (activeCounter >= maxThreads) {
                  wait();
              }
              activeCounter++;
          }
  
          this.threadPoolExecutor.execute(new Runnable() {
              public void run() {
                  try {
                      try {
                          final E outcome = task.runParallel();
                          synchronized (resultMap) {
                              resultMap.put(id, new Result(outcome));
                          }
                      } catch (Throwable th) {
                          synchronized (resultMap) {
                              resultMap.put(id, new Result(null, th));
                          }
                      } finally {
                          processResults();
                          synchronized (FifoTaskExecutor.this) {
                              activeCounter--;
                              FifoTaskExecutor.this.notifyAll();
                          }
                      }
                  } catch (Exception ex) {
                      Logger.getLogger(FifoTaskExecutor.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
                  }
              }
          });
      }
docs: Executes the submitted task. If the maximum number of pooled threads is
  in use, this method blocks until one of a them is available.
  
  @param task
  @throws InterruptedException