Author: toad
Date: 2007-08-11 20:24:24 +0000 (Sat, 11 Aug 2007)
New Revision: 14636

Modified:
   trunk/freenet/src/freenet/support/PooledExecutor.java
Log:
Revert, doesn't make sense.

Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java       2007-08-11 
20:21:18 UTC (rev 14635)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java       2007-08-11 
20:24:24 UTC (rev 14636)
@@ -4,7 +4,6 @@
 package freenet.support;

 import java.util.ArrayList;
-import java.util.LinkedList;

 /**
  * Pooled Executor implementation. Create a thread when we need one, let them 
die
@@ -14,7 +13,7 @@
 public class PooledExecutor implements Executor {

        private final ArrayList runningThreads /* <MyThread> */ = new 
ArrayList();
-       private final LinkedList waitingThreads /* <MyThread> */ = new 
LinkedList();
+       private final ArrayList waitingThreads /* <MyThread> */ = new 
ArrayList();
        long threadCounter = 0;

        /** Maximum time a thread will wait for a job */
@@ -26,7 +25,7 @@
                        boolean mustStart = false;
                        synchronized(this) {
                                if(!waitingThreads.isEmpty()) {
-                                       t = (MyThread) 
waitingThreads.removeLast();
+                                       t = (MyThread) 
waitingThreads.remove(waitingThreads.size()-1);
                                } else {
                                        // Will be coalesced by thread count 
listings if we use "@" or "for"
                                        t = new MyThread("Pooled thread 
awaiting work @"+(threadCounter++));
@@ -81,7 +80,7 @@

                                if(job == null) {
                                        synchronized(PooledExecutor.this) {
-                                               waitingThreads.addFirst(this);
+                                               waitingThreads.add(this);
                                        }
                                        synchronized(this) {
                                                if(nextJob == null) {


Reply via email to