void cleanUp() {
      long c = count.decrementAndGet();
      if (c <= 0) {
        synchronized (lock) {
          if (count.get() <= 0 && usable.get()) { // Don't attempt to remove row if already removed
            usable.set(false);
            RowLockContext removed = lockedRows.remove(row);
            assert removed == this : "we should never remove a different context";
          }
        }
      }
    }
Get an exclusive ( write lock ) lock on a given row.
@param row Which row to lock.
@return A locked RowLock. The lock is exclusive and already aqquired.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java