Author: toad
Date: 2007-03-25 01:23:23 +0000 (Sun, 25 Mar 2007)
New Revision: 12362

Modified:
   trunk/freenet/src/freenet/client/StandardOnionFECCodec.java
Log:
Still getting 32 FEC Pool threads. Maybe this will fix.

Modified: trunk/freenet/src/freenet/client/StandardOnionFECCodec.java
===================================================================
--- trunk/freenet/src/freenet/client/StandardOnionFECCodec.java 2007-03-25 
01:13:28 UTC (rev 12361)
+++ trunk/freenet/src/freenet/client/StandardOnionFECCodec.java 2007-03-25 
01:23:23 UTC (rev 12362)
@@ -392,7 +392,7 @@

        public static void addToQueue(FECJob job, StandardOnionFECCodec codec){
                synchronized (_awaitingJobs) {
-                       if((fecRunnerThread == null) || 
!fecRunnerThread.isAlive()){
+                       if(fecRunnerThread == null) {
                                if(fecRunnerThread != null) 
Logger.error(StandardOnionFECCodec.class, "The callback died!! restarting a new 
one, please report that error.");
                                fecRunnerThread = new Thread(fecRunner, "FEC 
Pool");
                                fecRunnerThread.setDaemon(true);
@@ -435,6 +435,7 @@
        private static class FECRunner implements Runnable {

                public void run(){
+                       try {
                        while(true){
                                FECJob job = null;
                                try {
@@ -481,6 +482,7 @@
                                        } catch (InterruptedException e) {}
                                }
                        }
+                       } finally { fecRunnerThread = null; }
                }
        }
 }


Reply via email to