*) Adding missing synchronized blocks

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@608 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent 0dfa8b62e2
commit cc1df08069

@ -133,19 +133,25 @@ 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 {
responseHeaderDB.set(urlHash, responseHeader);

Loading…
Cancel
Save