code: public boolean checkLocks( boolean exclusive,
                                 int depth ) {
          if (checkParents(exclusive) && checkChildren(exclusive, depth)) {
              return true;
          }
          return false;
      }
docs: checks if a lock of the given exclusivity can be placed, only considering children up to "depth"
  
  @param exclusive wheather the new lock should be exclusive
  @param depth the depth to which should be checked
  @return true if the lock can be placed