code: public int getWaiting()
      {
          if (!hasWaiters())
              return 0;
          Iterator<RegisteredSignal> iter = queue.iterator();
          int count = 0;
          while (iter.hasNext())
          {
              Signal next = iter.next();
              if (!next.isCancelled())
                  count++;
          }
          return count;
      }
docs: Return how many threads are waiting
  @return