Author: robert
Date: 2007-12-28 20:25:25 +0000 (Fri, 28 Dec 2007)
New Revision: 16831
Modified:
trunk/freenet/src/freenet/node/Node.java
Log:
minor synchronization improvement
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2007-12-28 20:23:03 UTC (rev
16830)
+++ trunk/freenet/src/freenet/node/Node.java 2007-12-28 20:25:25 UTC (rev
16831)
@@ -2256,17 +2256,21 @@
/**
* Has a request completed with this ID recently?
*/
- public synchronized boolean recentlyCompleted(long id) {
+ public boolean recentlyCompleted(long id) {
+ synchronized (recentlyCompletedIDs) {
return recentlyCompletedIDs.contains(new Long(id));
+ }
}
/**
* A request completed (regardless of success).
*/
- synchronized void completed(long id) {
+ void completed(long id) {
+ synchronized (recentlyCompletedIDs) {
recentlyCompletedIDs.push(new Long(id));
while(recentlyCompletedIDs.size() > MAX_RECENTLY_COMPLETED_IDS)
recentlyCompletedIDs.pop();
+ }
}
/**