code: public synchronized void synchronize() throws InterruptedException {
          check(n);
  
          try {
              onCriteriaMet();
          } catch (Error | RuntimeException e) {
              abort(e);
              throw e;
          }
  
          check(n*2);
      }
docs: Waits for N threads to enter the {@link #synchronize()} method, then
  returns.
  
  @return
  returns normally if N threads successfully synchronized.
  @throws InterruptedException
  if any of the threads that were synchronizing get interrupted,
  or if the {@link #abort(Throwable)} is called.