Author: toad
Date: 2009-04-02 18:15:34 +0000 (Thu, 02 Apr 2009)
New Revision: 26372

Modified:
   trunk/freenet/src/freenet/client/FECQueue.java
Log:
Don't recalculate fec threads here, that would undermine OOM handler. But do 
calculate it on startup, or we won't run any jobs! :)


Modified: trunk/freenet/src/freenet/client/FECQueue.java
===================================================================
--- trunk/freenet/src/freenet/client/FECQueue.java      2009-04-02 18:12:08 UTC 
(rev 26371)
+++ trunk/freenet/src/freenet/client/FECQueue.java      2009-04-02 18:15:34 UTC 
(rev 26372)
@@ -83,6 +83,7 @@
                        transientQueue[i] = new LinkedList();
                        persistentQueueCache[i] = new LinkedList();
                }
+               maxRunningFECThreads = getMaxRunningFECThreads();
                OOMHandler.addOOMHook(this);
                initRunner();
                initCacheFillerJob();
@@ -326,8 +327,8 @@
                                        // Don't notify, let it sleep until 
more jobs are added.
                                        return;
                                } else {
-                                       int maxRunningThreads = 
getMaxRunningFECThreads();
                                        synchronized(FECQueue.this) {
+                                               int maxRunningThreads = 
maxRunningFECThreads;
                                                if(runningFECThreads < 
maxRunningThreads) {
                                                        int queueSize = 0;
                                                        for(int 
i=0;i<priorities;i++) {

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to