private static Cache basicGetInstance(DistributedSystem system, boolean closeOk) {
    // Avoid synchronization if this is an initialization thread to avoid
    // deadlock when messaging returns to this VM
    final InitializationLevel initReq = LocalRegion.getThreadInitLevelRequirement();
    if (initReq == ANY_INIT || initReq == BEFORE_INITIAL_IMAGE) {
      return basicGetInstancePart2(system, closeOk);
    } else {
      synchronized (InternalCacheBuilder.class) {
        return basicGetInstancePart2(system, closeOk);
      }
    }
  }
@throws CacheClosedException if a cache has not been created or the only created one is
        {@link Cache#isClosed closed}
geode-core/src/main/java/org/apache/geode/internal/cache/CacheFactoryStatics.java