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

Loading…
Cancel
Save