code: private void lockRow(int row, int colsToLock) {
          // Put in an entry for all the row's columns
          for (int col = 0; col < colsToLock; ++col) {
              Entry e = new Entry(row, col);
              // Spin waiting for the entry to be unlocked
              while (lockedEntries.putIfAbsent(e, new Object()) != null)
                  ;
          }
      }
docs: Locks all the column entries for this row, thereby preventing write or
  read access to the values.  Note that the number of columns to lock
  <b>must</b> be the same value used with {@link #unlockRow(int,int)},
  otherwise the unlock may potentially unlock matrix entries associated
  with this lock call.
  
  @param row the row to lock
  @param colsToLock the number of rows to lock.  This value should be the
  number of {@link #cols} at the time of the call.