Update of /cvsroot/freenet/freenet/src/freenet/thread
In directory sc8-pr-cvs1:/tmp/cvs-serv24461/freenet/thread

Modified Files:
        QThreadFactory.java 
Log Message:
Thanks to Niklas for pointing this out, we should never kill threads to below 
MINIMUM_AVAILABLE_ABS

Index: QThreadFactory.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/thread/QThreadFactory.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- QThreadFactory.java 29 Sep 2003 06:56:34 -0000      1.39
+++ QThreadFactory.java 10 Oct 2003 19:15:36 -0000      1.40
@@ -87,7 +87,7 @@
                 int allowed;
                                countLock.snap(snap);
                                // start with a maximal allowed value.
-                               allowed = (int)(snap.active * MAXIMUM_AVAILABLE_RATIO);
+                               allowed = Math.max((int)(snap.active * 
MAXIMUM_AVAILABLE_RATIO),2 * MINIMUM_AVAILABLE_ABS);
                                // Repeatedly remove a thread from the stack and 
signal it to die.
                                // But if all of the threads have meanwhile started 
jobs, then
                                // do nothing, and the loop will terminate with 
snap.available == 0

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to