Author: nextgens
Date: 2006-10-03 10:41:48 +0000 (Tue, 03 Oct 2006)
New Revision: 10595

Modified:
   trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java
   trunk/freenet/src/freenet/node/Node.java
Log:
Fix FreenetFilePersistentConfig

Modified: trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java   
2006-10-02 20:40:20 UTC (rev 10594)
+++ trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java   
2006-10-03 10:41:48 UTC (rev 10595)
@@ -13,13 +13,9 @@
        public final Runnable thread = new Runnable() {
                public void run() {
                        while(!hasNodeStarted){
-                               synchronized (this) {
-                                       hasNodeStarted = true;
-                                       try{
-                                               wait(100);
-                                       } catch (InterruptedException e) {
-                                               hasNodeStarted = false; 
-                                       }
+                               try {
+                                       Thread.sleep(1000);
+                               } catch (InterruptedException e) {
                                }
                        }

@@ -63,4 +59,9 @@
                super.finishedInit();
                this.ticker = ticker;
        }
+
+       public void setHasNodeStarted() {
+               if(hasNodeStarted) Logger.error(this, "It has already been 
called! that shouldn't happen!");
+               this.hasNodeStarted = true;
+       }
 }

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2006-10-02 20:40:20 UTC (rev 
10594)
+++ trunk/freenet/src/freenet/node/Node.java    2006-10-03 10:41:48 UTC (rev 
10595)
@@ -1409,10 +1409,8 @@

                // After everything has been created, write the config file 
back to disk.
                config.finishedInit(this.ps);
+               config.setHasNodeStarted();
                config.store();
-               synchronized (config.thread) {
-                       config.thread.notify(); 
-               }

                // Process any data in the extra peer data directory
                peers.readExtraPeerData();
@@ -2670,35 +2668,35 @@
        }

        public int getSwaps() {
-               return lm.swaps;
+               return LocationManager.swaps;
        }

        public int getNoSwaps() {
-               return lm.noSwaps;
+               return LocationManager.noSwaps;
        }

        public int getStartedSwaps() {
-               return lm.startedSwaps;
+               return LocationManager.startedSwaps;
        }

        public int getSwapsRejectedAlreadyLocked() {
-               return lm.swapsRejectedAlreadyLocked;
+               return LocationManager.swapsRejectedAlreadyLocked;
        }

        public int getSwapsRejectedLoop() {
-               return lm.swapsRejectedLoop;
+               return LocationManager.swapsRejectedLoop;
        }

        public int getSwapsRejectedNowhereToGo() {
-               return lm.swapsRejectedNowhereToGo;
+               return LocationManager.swapsRejectedNowhereToGo;
        }

        public int getSwapsRejectedRateLimit() {
-               return lm.swapsRejectedRateLimit;
+               return LocationManager.swapsRejectedRateLimit;
        }

        public int getSwapsRejectedRecognizedID() {
-               return lm.swapsRejectedRecognizedID;
+               return LocationManager.swapsRejectedRecognizedID;
        }

        /**


Reply via email to