ThreadPoolExecutor and finalization

Doug Lea dl at
Tue Oct 31 11:07:55 UTC 2017

On 10/31/2017 04:55 AM, David Holmes wrote:
> In 2006 we added the docs about it being unreferenced and no remaining
> threads - which I guess is a necessary condition for finalization to now
> occur. But as you noted at that point shutdown() is pretty much a no-op.
> Maybe Doug (cc'd) can recall the gory details. :)
We added the wording to deal with complaints that pools were not
being auto-shutdown. But we didn't notice that the conditions for
finalization to trigger were the same as the conditions for
finalization not being necessary! (Just GCing would be fine.)

The best solution seems to be just to remove the method, and
adjust the javadoc wording to refer to GC vs finalization.

I think this would be binary compatible?


More information about the core-libs-dev mailing list