code: public boolean lockerWaitingOn(Locker locker, Locker target)
      {
          //-------------------------------------------------------------
          // Locker can be waiting on at most one lock. If that lock
          // is held by target or if any of the holders of that lock
          // is waiting on the target then locker is waiting on target.
          //-------------------------------------------------------------
  
          Lock waitingOn = (Lock) waitTable.get(locker);
  
          if (waitingOn == null) {
              return false;
          }
  
          Enumeration holders = waitingOn.getHolders();
          while (holders.hasMoreElements()) {
              Locker next = (Locker) holders.nextElement();
              if (next == target) {
                  return true;
              }
              if (lockerWaitingOn(next, target)) {
                  return true;
              }
          }
          return false;
      }
docs: /*
  Return true iff the given locker is waiting on the given target;
  recurse as necessary.