code: public long getCompletedTaskCount() {
          final ReentrantLock mainLock = this.mainLock;
          mainLock.lock();
          try {
              long n = completedTaskCount;
              for (Worker w : workers)
                  n += w.completedTasks;
              return n;
          } finally {
              mainLock.unlock();
          }
      }
docs: Returns the approximate total number of tasks that have
  completed execution. Because the states of tasks and threads
  may change dynamically during computation, the returned value
  is only an approximation, but one that does not ever decrease
  across successive calls.
  
  @return the number of tasks