public synchronized void populateUnits() { initRats(); initRatTree(); // Give the MSC some time to initialize MechSummaryCache msc = MechSummaryCache.getInstance(); long waitLimit = System.currentTimeMillis() + 3000; /* 3 seconds */ while( !interrupted && !msc.isInitialized() && waitLimit > System.currentTimeMillis() ) { try { Thread.sleep(50); } catch(InterruptedException e) { // Ignore } } loadRatsFromDirectory(Configuration.armyTablesDir(), msc); cleanupNode(ratTree); if (!interrupted) { rug.initialized = true; rug.notifyListenersOfInitialization(); } if (dispose) { clear(); dispose = false; } }