Author: toad
Date: 2008-06-21 16:00:15 +0000 (Sat, 21 Jun 2008)
New Revision: 20580

Modified:
   branches/db4o/freenet/src/freenet/support/PrioritizedSerialExecutor.java
Log:
Doh!

Modified: 
branches/db4o/freenet/src/freenet/support/PrioritizedSerialExecutor.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/PrioritizedSerialExecutor.java    
2008-06-21 15:46:00 UTC (rev 20579)
+++ branches/db4o/freenet/src/freenet/support/PrioritizedSerialExecutor.java    
2008-06-21 16:00:15 UTC (rev 20580)
@@ -34,13 +34,7 @@
                        while(true) {
                                Runnable job = null;
                                synchronized(jobs) {
-                                       for(int i=0;i<jobs.length;i++) {
-                                               job = checkQueue();
-                                               if(!jobs[i].isEmpty()) {
-                                                       job = (Runnable) 
jobs[i].removeFirst();
-                                                       break;
-                                               }
-                                       }
+                                       job = checkQueue();
                                        if(job == null) {
                                                waiting = true;
                                                try {
@@ -58,6 +52,8 @@
                                        }
                                }
                                try {
+                                       if(Logger.shouldLog(Logger.MINOR, this))
+                                               Logger.minor(this, "Running job 
"+job);
                                        job.run();
                                } catch (Throwable t) {
                                        Logger.error(this, "Caught "+t, t);


Reply via email to