Author: nextgens
Date: 2006-11-26 10:39:58 +0000 (Sun, 26 Nov 2006)
New Revision: 11056
Modified:
trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
Log:
improve r11052 : spare a System.currentTimeMillis() on the filter-checking loop
Modified: trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/UdpSocketManager.java 2006-11-26
04:31:13 UTC (rev 11055)
+++ trunk/freenet/src/freenet/io/comm/UdpSocketManager.java 2006-11-26
10:39:58 UTC (rev 11056)
@@ -455,7 +455,6 @@
long now = System.currentTimeMillis();
long messageDropTime = now - MAX_UNCLAIMED_FIFO_ITEM_LIFETIME;
long messageLifeTime = 0;
- long tStart = System.currentTimeMillis();
synchronized (_filters) {
if(logMINOR) Logger.minor(this, "Checking _unclaimed");
for (ListIterator i = _unclaimed.listIterator();
i.hasNext();) {
@@ -496,11 +495,11 @@
}
}
long tEnd = System.currentTimeMillis();
- if(tEnd - tStart > 50) {
- if(tEnd - tStart > 500)
- Logger.error(this, "waitFor _unclaimed
iteration took "+(tEnd-tStart)+"ms with unclaimedFIFOSize of
"+_unclaimed.size()+" for ret of "+ret);
+ if(tEnd - now > 50) {
+ if(tEnd - now > 500)
+ Logger.error(this, "waitFor _unclaimed
iteration took "+(tEnd-now)+"ms with unclaimedFIFOSize of "+_unclaimed.size()+"
for ret of "+ret);
else
- Logger.normal(this, "waitFor _unclaimed
iteration took "+(tEnd-tStart)+"ms with unclaimedFIFOSize of
"+_unclaimed.size()+" for ret of "+ret);
+ Logger.normal(this, "waitFor _unclaimed
iteration took "+(tEnd-now)+"ms with unclaimedFIFOSize of "+_unclaimed.size()+"
for ret of "+ret);
}
// Unlock to wait on filter
// Waiting on the filter won't release the outer lock