hbase-oss/src/main/java/org/apache/hadoop/hbase/oss/sync/ZKTreeLockManager.java
@Override
  protected synchronized boolean writeLockAbove(Path p) throws IOException {
    LOG.debug("Checking for write lock above {}", p);
    while (!p.isRoot()) {
      p = p.getParent();
      if (isLocked(get(p).writeLock())) {
        LOG.debug("Parent write lock currently held: {}", p);
        return true;
      }
    }
    return false;
  }
/*
  We need to protect this block against potential concurrent calls to close()
   */
We need to protect this block against potential concurrent calls to close()
We need to protect this block against potential concurrent calls to close ()
@Override
  protected synchronized boolean writeLockAbove(Path p) throws IOException {
    LOG.debug("Checking for write lock above {}", p);
    while (!p.isRoot()) {
      p = p.getParent();
      if (isLocked(get(p).writeLock())) {
        LOG.debug("Parent write lock currently held: {}", p);
        return true;
      }
    }
    return false;
  }
@ Override protected synchronized boolean writeLockAbove ( Path p ) throws IOException { LOG . debug ( "Checking for write lock above {}" , p ) ; while ( ! p . isRoot ( ) ) { p = p . getParent ( ) ; if ( isLocked ( get ( p ) . writeLock ( ) ) ) { LOG . debug ( "Parent write lock currently held: {}" , p ) ; return true ; } } return false ; }
We need to protect this block against potential concurrent calls to close()
We need to protect this block against potential concurrent calls to close ()