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

Loading…
Cancel
Save