Code Review 7091003: ScheduledExecutorService never executes Runnable with corePoolSize of zero (original) (raw)
David Holmes david.holmes at oracle.com
Fri Sep 23 02:34:06 UTC 2011
- Previous message: Code Review 7091003: ScheduledExecutorService never executes Runnable with corePoolSize of zero
- Next message: hg: jdk8/tl/jdk: 7091003: ScheduledExecutorService never executes Runnable with corePoolSize of zero
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 23/09/2011 9:26 AM, Doug Lea wrote:
On 09/22/11 17:45, David Holmes wrote:
Sorry Doug/Chris I should have seen this previously, the order here is wrong:
1552 void ensurePrestart() { 1553 int wc = workerCountOf(ctl.get()); 1554 if (wc == 0) 1555 addWorker(null, false); 1556 else if (wc < corePoolSize)_ _1557 addWorker(null, true);_ _1558 }_ _this will always mark the first worker as non-core even if the_ _corePoolSize is > 0. It needs to be swapped Where "needs" means "to be even more accommodating". I agree; done.
Sorry Doug I put too much weight on the "core" argument to addWorker. I assumed it was flagging this worker as a core-thread (or not) and so subject to core-thread timeout rules (or not). But it isn't - which of course I should know. ;-)
David
-Doug
- Previous message: Code Review 7091003: ScheduledExecutorService never executes Runnable with corePoolSize of zero
- Next message: hg: jdk8/tl/jdk: 7091003: ScheduledExecutorService never executes Runnable with corePoolSize of zero
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]