Avoid ConcurrentModificationException when accessing the PerformanceQueues page while yacy is indexing.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4170 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 18 years ago
parent 35303f9504
commit d732840f8a

@ -131,11 +131,13 @@ public final class plasmaWordIndex implements indexRI {
long cacheBytes = 0;
long entryBytes = indexRWIEntry.urlEntryRow.objectsize();
indexRAMRI cache = (in ? dhtInCache : dhtOutCache);
Iterator it = cache.wordContainers(null, false);
indexContainer ic;
while ( it.hasNext() ) {
ic = (indexContainer)it.next();
cacheBytes += ic.size() * entryBytes;
synchronized (cache) {
Iterator it = cache.wordContainers(null, false);
indexContainer ic;
while ( it.hasNext() ) {
ic = (indexContainer)it.next();
cacheBytes += ic.size() * entryBytes;
}
}
return cacheBytes;

Loading…
Cancel
Save