private <T> T withLock(int fileId, @NotNull Computable<T> computable, boolean readLock) {
    ReadWriteLock readWriteLock = getLock(fileId);
    Lock lock = readLock ? readWriteLock.readLock() : readWriteLock.writeLock();
    lock.lock();
    try {
      return computable.compute();
    }
    finally {
      lock.unlock();
    }
  }
private <T> T withLock(int fileId, @NotNull Computable<T> computable, boolean readLock)