Skip to content

Commit

Permalink
*) Adding missing synchronized blocks
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@608 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
theli committed Aug 30, 2005
1 parent 0dfa8b6 commit cc1df08
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions source/de/anomic/plasma/plasmaHTCache.java
Expand Up @@ -133,18 +133,24 @@ public plasmaHTCache(File htCachePath, long maxCacheSize, int bufferkb) {
}

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 {
Expand Down

0 comments on commit cc1df08

Please sign in to comment.