code: private Content doComputeUnlimited(String path, CountDownLatch gate) throws IOException {
          long startContent;
          long endContent;
          ByteArrayOutputStream result;
          References references;
          byte[] bytes;
          String hash;
          Content content;
  
          if (gate.getCount() != 1) {
              throw new IllegalStateException(path + " " + gate.getCount());
          }
          startContent = System.currentTimeMillis();
          try {
              try {
                  references = repository.resolve(Request.parse(path));
              } catch (CyclicDependency e) {
                  throw new RuntimeException(e.toString(), e);
              } catch (IOException e) {
                  throw new IOException(path + ": " + e.getMessage(), e);
              }
              result = new ByteArrayOutputStream();
              try (OutputStream dest = new GZIPOutputStream(result); Writer writer = new OutputStreamWriter(dest, ENCODING)) {
                  references.writeTo(writer);
              }
              bytes = result.toByteArray();
              endContent = System.currentTimeMillis();
              hash = hash(bytes);
              content = new Content(references.type.getMime(), references.getLastModified(), bytes);
              hashCache.add(path, hash, endContent /* that's where hash computation starts */, 0 /* too small for meaningful measures */);
              contentCache.add(hash, content, startContent, endContent - startContent);
          } finally {
              synchronized (pending) {
                  if (gate.getCount() != 1) {
                      throw new IllegalStateException(path + " " + gate.getCount());
                  }
                  if (pending.remove(path) != gate) {
                      throw new IllegalStateException();
                  }
                  gate.countDown();
              }
          }
          return content;
  
      }
docs: exactly one thread will invoke this method for one path