From cc1df08069ebdd6e0aed09924ab6bae67df4eb79 Mon Sep 17 00:00:00 2001 From: theli Date: Tue, 30 Aug 2005 14:57:32 +0000 Subject: [PATCH] *) Adding missing synchronized blocks git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@608 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaHTCache.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java index 11cca0fb0..4af438404 100644 --- a/source/de/anomic/plasma/plasmaHTCache.java +++ b/source/de/anomic/plasma/plasmaHTCache.java @@ -133,18 +133,24 @@ public final class plasmaHTCache { } public int size() { - return cacheStack.size(); + synchronized (this.cacheStack) { + return this.cacheStack.size(); + } } public void push(Entry entry) { - cacheStack.add(entry); + synchronized (this.cacheStack) { + this.cacheStack.add(entry); + } } public Entry pop() { - if (cacheStack.size() > 0) - return (Entry) cacheStack.removeFirst(); + synchronized (this.cacheStack) { + if (this.cacheStack.size() > 0) + return (Entry) this.cacheStack.removeFirst(); else return null; + } } public void storeHeader(String urlHash, httpHeader responseHeader) throws IOException {