Author: j16sdiz
Date: 2009-04-14 04:42:50 +0000 (Tue, 14 Apr 2009)
New Revision: 26768

Modified:
   trunk/freenet/src/freenet/node/FailureTableEntry.java
Log:
Don't call shouldLog() for each instance

Modified: trunk/freenet/src/freenet/node/FailureTableEntry.java
===================================================================
--- trunk/freenet/src/freenet/node/FailureTableEntry.java       2009-04-14 
04:42:30 UTC (rev 26767)
+++ trunk/freenet/src/freenet/node/FailureTableEntry.java       2009-04-14 
04:42:50 UTC (rev 26768)
@@ -42,8 +42,17 @@
        long[] requestedTimeouts;
        short[] requestedTimeoutHTLs;
        
-       static boolean logMINOR;
+       private static volatile boolean logMINOR;
        
+       static {
+               Logger.registerLogThresholdCallback(new LogThresholdCallback() {
+                       @Override
+                       public void shouldUpdate() {
+                               logMINOR = Logger.shouldLog(Logger.MINOR, this);
+                       }
+               });
+       }
+       
        /** We remember that a node has asked us for a key for up to an hour; 
after that, we won't offer the key, and
         * if we receive an offer from that node, we will reject it */
        static final int MAX_TIME_BETWEEN_REQUEST_AND_OFFER = 60 * 60 * 1000;
@@ -57,7 +66,6 @@
        FailureTableEntry(Key key) {
                this.key = key;
                if(key == null) throw new NullPointerException();
-               logMINOR = Logger.shouldLog(Logger.MINOR, this);
                long now = System.currentTimeMillis();
                creationTime = now;
                receivedTime = -1;

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to