Code Review 7091003: ScheduledExecutorService never executes Runnable with corePoolSize of zero

Chris Hegarty chris.hegarty at oracle.com
Thu Sep 22 16:54:23 UTC 2011


This change is coming from Doug Lea's CVS and I've already review it.

It seems that in the re-work that was done for Java 7 we dropped this 
corner case.

STPE.delayedExecute will add the task to the work queue and invoke 
prestartCoreThread. But prestartCoreThread checks for the worker count 
(0) being less than corePoolSize (0) and as that is not the case nothing 
happens. So we have a task in the queue but no thread waiting to execute it.

For STPE when the queue is not empty there must always be at least one 
thread waiting on the queue.

http://cr.openjdk.java.net/~chegar/7091003/webrev.00/webrev/

-Chris.



More information about the core-libs-dev mailing list