private boolean startLoading(String name) {
    Set classesAndResources = (Set) beingLoaded.get();
    if (classesAndResources != null && classesAndResources.contains(name)) return false;

    if (classesAndResources == null) {
      classesAndResources = new HashSet(3);
      beingLoaded.set(classesAndResources);
    }
    classesAndResources.add(name);
    return true;
  }
 private void stopLoading(String name) {
   ((Set) beingLoaded.get()).remove(name);
 }