From d732840f8a4c0f3a27d9e6e56298455de63bc664 Mon Sep 17 00:00:00 2001 From: hermens Date: Fri, 19 Oct 2007 23:36:40 +0000 Subject: [PATCH] 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 --- source/de/anomic/plasma/plasmaWordIndex.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index b632e6969..86252ad1b 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -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;