code: public <T> T execute(Task<T> task) {
          synchronized(task) {
              task.reset();
              // add it to the tail
              taskList.add(task);
  
              // invoke the execution
              lock.activate();
  
              // wait for the completion
              try {
              	while (!task.isDone()) {
              		task.wait();
              	}
              } catch (InterruptedException e) {
                  task.exception = e; // we got interrupted, so task.result will be invalid! 
              }
  
              if(task.exception!=null) {
                  Throwable e = task.exception;
                  task.exception = null;
                  throw new ExecutionException(e);
              } else {
                  T r = task.result;
                  task.result = null;
                  return r;
              }
          }
      }
docs: Executes a {@link Task} in a {@link ComThread}
  and returns its result.
  @param task The task to be executed
  @param <T> The type of the return value.
  @return The result of the Task