code: public static WorkQueue getWorkQueue(int numThreads) {
          if (singleton == null) {
              synchronized (WorkQueue.class) {
                  if (singleton == null)
                      singleton = new WorkQueue(numThreads); 
              }
          }
  
          while (singleton.availableThreads() < numThreads) {
              singleton.addThread();
          }
          return singleton;
      }
docs: Returns the canonical instance of the {@link WorkQueue} to be used in
  running concurrent tasks, ensuring the <i>at least</i> the specified
  number of threads are available.