code: public int getActiveCount() {
          final ReentrantLock mainLock = this.mainLock;
          mainLock.lock();
          try {
              int n = 0;
              for (Worker w : workers)
                  if (w.isLocked())
                      ++n;
              return n;
          } finally {
              mainLock.unlock();
          }
      }
docs: Returns the approximate number of threads that are actively
  executing tasks.
  
  @return the number of threads