}
// Iterate modules
Iterator modIt = modules.iterator();
while (modIt.hasNext()) {
CSAuthModule mod = (CSAuthModule) modIt.next();
// Look if a collector runs right now. If not, then this module is thru
if (mod.getCurrentCollectorThread() == null) {
modIt.remove();
}
// A collection runs right now.
else {
// Retrieve an maybe recorded earlier thread
Thread earlierThread = (Thread) moduleThreads.get(mod);
// if there is no earlier thread then we just haven't recorded it yet
if (earlierThread == null) {
moduleThreads.put(mod, mod.getCurrentCollectorThread());
}
// If there was an earlier thread, we look if it is still the same. If not, the earlier thread is finished and our update most likely thru
else if (!earlierThread.equals(mod.getCurrentCollectorThread())) {
modIt.remove();
}
}
}