Author: nextgens
Date: 2007-03-24 01:42:16 +0000 (Sat, 24 Mar 2007)
New Revision: 12298

Modified:
   trunk/freenet/src/freenet/client/StandardOnionFECCodec.java
Log:
Using Thread.isAlive() is probably more effective/sensible

Modified: trunk/freenet/src/freenet/client/StandardOnionFECCodec.java
===================================================================
--- trunk/freenet/src/freenet/client/StandardOnionFECCodec.java 2007-03-24 
01:33:50 UTC (rev 12297)
+++ trunk/freenet/src/freenet/client/StandardOnionFECCodec.java 2007-03-24 
01:42:16 UTC (rev 12298)
@@ -432,7 +432,7 @@
        // ###############################

        public void addToQueue(Bucket[] dataBlocks, Bucket[] checkBlocks, int 
blockLength, BucketFactory bucketFactory, StandardOnionFECCodecEncoderCallback 
callback){
-               if(!fecRunner.getIsStarted()) fecRunnerThread.start();
+               if(!fecRunnerThread.isAlive()) fecRunnerThread.start();

                synchronized (_awaitingJobs) {
                        _awaitingJobs.addFirst(new FECJob(dataBlocks, 
checkBlocks, blockLength, bucketFactory, callback));
@@ -466,11 +466,8 @@
                }
        }

-       private class FECRunner implements Runnable {
-               private boolean isStarted = false;
-               
+       private class FECRunner implements Runnable {           
                public void run(){
-                       isStarted = true;
                        while(true){
                                FECJob job = null;
                                // Get a job
@@ -500,9 +497,5 @@
                                }
                        }
                }
-               
-               public boolean getIsStarted(){
-                       return isStarted;
-               }
        }
 }


Reply via email to