code: public static void await(String name, long time, TimeUnit unit) throws InterruptedException {
      try (LockResource r = new LockResource(sLock)) {
        while (!sTimers.containsKey(name)) {
          if (!sCondition.await(time, unit)) {
            throw new RuntimeException(
                "Timed out waiting for thread " + name + " to be ready for scheduling");
          }
        }
      }
    }
docs: Waits until the given thread can be executed, throwing an unchecked exception of the given
  timeout expires.
  
  @param name a name of the thread to wait for
  @param time the maximum time to wait
  @param unit the time unit of the {@code time} argument
  @throws InterruptedException if the waiting thread is interrupted