On Tuesday 20 February 2001 17:24, Scott (from Oskar's mail) wrote:
> (From Scott actually):
>
> I posted the change on the list, but never put it in actual code (its
> trivial, you guys can handle a one line change). The change is
> applicable to any tree.
>
> Scott
>
Mr. Bad:
Here's a patch with the change. It's not exactly what Scott wrote, but I'm
pretty sure it's what he meant. It also includes a one line fix to
ThreadPool.fillThreadStack which was already discussed.
Here are before and after code snippets...
After patch:
---
if (threads.isEmpty() &&
((runningThreads() < maxThreads) || (maxThreads==0))) {
// Make a new thread.
host=new EThread(this);
}
else {
// Use an old thread, possibly waiting if none
// is immediately available.
host=(EThread)threads.pop();
}
---
Before patch, CVS cvs ThreadPool.java ver. 1.14: Line 215
---
if (maxThreads > 0 || !threads.isEmpty())
host=(EThread)threads.pop();
else
host=new EThread(this);
---
If no one screams loudly could you apply this at least to the trunk branch.
-- gj
--
Web page inside Freenet:
freenet:MSK at SSK@enI8YFo3gj8UVh-Au0HpKMftf6QQAgE/homepage//
-------------- next part --------------
A non-text attachment was scrubbed...
Name: threadpool.patch.1
Type: text/x-c++
Size: 732 bytes
Desc: not available
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20010220/80537e5d/attachment.bin>