public int getActiveCount() {
    _mainLock.lock();

    try {
      int count = 0;

      for (WorkerTask workerTask : _workerTasks) {
        if (workerTask._isLocked()) {
          count++;
        }
      }

      return count;
    } finally {
      _mainLock.unlock();
    }
  }
  public long getTaskCount() {
    _mainLock.lock();

    try {
      long count = _completedTaskCount;

      for (WorkerTask workerTask : _workerTasks) {
        count += workerTask._localCompletedTaskCount;

        if (workerTask._isLocked()) {
          count++;
        }
      }

      return count + _taskQueue.size();
    } finally {
      _mainLock.unlock();
    }
  }