Author: nextgens
Date: 2006-10-03 14:10:58 +0000 (Tue, 03 Oct 2006)
New Revision: 10597

Modified:
   trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java
Log:
More work on FreenetFilePersistentConfig

Modified: trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java   
2006-10-03 11:05:17 UTC (rev 10596)
+++ trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java   
2006-10-03 14:10:58 UTC (rev 10597)
@@ -12,10 +12,11 @@
        private Ticker ticker;
        public final Runnable thread = new Runnable() {
                public void run() {
-                       while(!hasNodeStarted){
-                               try {
-                                       Thread.sleep(1000);
-                               } catch (InterruptedException e) {
+                       synchronized (this) {
+                               while(!hasNodeStarted){
+                                       try {
+                                               wait(1000);
+                                       } catch (InterruptedException e) {}
                                }
                        }

@@ -61,7 +62,10 @@
        }

        public void setHasNodeStarted() {
-               if(hasNodeStarted) Logger.error(this, "It has already been 
called! that shouldn't happen!");
-               this.hasNodeStarted = true;
+               synchronized (this) {
+                       if(hasNodeStarted) Logger.error(this, "It has already 
been called! that shouldn't happen!");
+                       this.hasNodeStarted = true;
+                       notify();
+               }
        }
 }


Reply via email to